# Path: onecodex/exceptions.py
# class OneCodexException(Exception):
#     pass


import pytest
import builtins
import json
import mock
import os
import sys
from xml.etree import ElementTree as ET
from onecodex.exceptions import OneCodexException
        from onecodex.notebooks import report
    from onecodex.notebooks import report
    from onecodex.notebooks import report
    from onecodex.notebooks import report
    from onecodex.notebooks import report
    from onecodex.notebooks import report
    from onecodex.notebooks import report
    from onecodex.notebooks import report
    from onecodex.notebooks import report
    from onecodex.notebooks import report
    from onecodex.notebooks import exporters
    from onecodex.notebooks import exporters
def test_reference_and_biblio(mock_reports):

    with pytest.raises(OneCodexException) as e:
        report.reference()
    assert "at least one of" in str(e.value)

    # duplicate references don't get new  numbers
    ref1 = report.reference("wikipedia reference 1")
    assert 1 == ref1.ref_num
    ref2 = report.reference("wikipedia reference 1")
    assert 1 == ref2.ref_num

    # new references get new numbers
    ref3 = report.reference("wikipedia reference 2")
    assert 2 == ref3.ref_num

    # lookup by tags works
    ref4 = report.reference("wikipedia reference 3", "wiki")
    assert 3 == ref4.ref_num
    ref5 = report.reference(label="wiki")
    assert 3 == ref5.ref_num

    with pytest.raises(OneCodexException) as e:
        report.reference(label="wiki2")
    assert "Cannot find citation" in str(e.value)

    with pytest.raises(OneCodexException) as e:
        report.reference("wikipedia reference 4", "wiki")
    assert "already in use" in str(e.value)


# Path: onecodex/exceptions.py
# class OneCodexException(Exception):
#     pass


# Path: tests/test_notebooks.py
import pytest
import builtins
import json
import mock
import os
import sys
from xml.etree import ElementTree as ET
from onecodex.exceptions import OneCodexException
        from onecodex.notebooks import report
    from onecodex.notebooks import report
    from onecodex.notebooks import report
    from onecodex.notebooks import report
    from onecodex.notebooks import report
    from onecodex.notebooks import report
    from onecodex.notebooks import report
    from onecodex.notebooks import report
    from onecodex.notebooks import report
    from onecodex.notebooks import report
    from onecodex.notebooks import exporters
    from onecodex.notebooks import exporters

def test_reference_and_biblio(mock_reports):

    with pytest.raises(OneCodexException) as e:
        report.reference()
    assert "at least one of" in str(e.value)

    # duplicate references don't get new  numbers
    ref1 = report.reference("wikipedia reference 1")
    assert 1 == ref1.ref_num
    ref2 = report.reference("wikipedia reference 1")
    assert 1 == ref2.ref_num

    # new references get new numbers
    ref3 = report.reference("wikipedia reference 2")
    assert 2 == ref3.ref_num

    # lookup by tags works
    ref4 = report.reference("wikipedia reference 3", "wiki")
    assert 3 == ref4.ref_num
    ref5 = report.reference(label="wiki")
    assert 3 == ref5.ref_num

    with pytest.raises(OneCodexException) as e:
        report.reference(label="wiki2")
    assert "Cannot find citation" in str(e.value)

    with pytest.raises(OneCodexException) as e:
        report.reference("wikipedia reference 4", "wiki")
    assert "already in use" in str(e.value)


    with pytest.raises(OneCodexException) as e: