# Path: hgvs/exceptions.py
# class HGVSError(Exception):
#     pass
# 
# class HGVSUnsupportedOperationError(HGVSError):
#     pass
# 
# Path: hgvs/enums.py



import unittest
import pytest
import hgvs.location
import hgvs.parser
from hgvs.exceptions import HGVSError, HGVSUnsupportedOperationError
from hgvs.enums import Datum
@pytest.mark.quick
class Test_BaseOffsetPosition(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        cls.hp = hgvs.parser.Parser()

    def test_success(self):
        # r.5
        cdsp = hgvs.location.BaseOffsetPosition(5)
        self.assertEqual(cdsp.datum, Datum.SEQ_START)
        self.assertEqual(cdsp.base, 5)
        self.assertEqual(cdsp.offset, 0)
        self.assertEqual(str(cdsp), "5")
        self.assertFalse(cdsp.is_intronic)

        #r.5+6
        cdsp.offset = 6
        self.assertEqual(str(cdsp), "5+6")
        self.assertTrue(cdsp.is_intronic)

        #r.5+?
        cdsp.offset = None
        self.assertEqual(str(cdsp), "5+?")
        self.assertTrue(cdsp.is_intronic)

        #r.(5+?)
        cdsp.uncertain = True
        self.assertEqual(str(cdsp), "(5+?)")

        # c.*5

# Path: hgvs/exceptions.py
# class HGVSError(Exception):
#     pass
# 
# class HGVSUnsupportedOperationError(HGVSError):
#     pass
# 
# Path: hgvs/enums.py



# Path: tests/test_hgvs_location.py
import unittest
import pytest
import hgvs.location
import hgvs.parser
from hgvs.exceptions import HGVSError, HGVSUnsupportedOperationError
from hgvs.enums import Datum

@pytest.mark.quick
class Test_BaseOffsetPosition(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        cls.hp = hgvs.parser.Parser()

    def test_success(self):
        # r.5
        cdsp = hgvs.location.BaseOffsetPosition(5)
        self.assertEqual(cdsp.datum, Datum.SEQ_START)
        self.assertEqual(cdsp.base, 5)
        self.assertEqual(cdsp.offset, 0)
        self.assertEqual(str(cdsp), "5")
        self.assertFalse(cdsp.is_intronic)

        #r.5+6
        cdsp.offset = 6
        self.assertEqual(str(cdsp), "5+6")
        self.assertTrue(cdsp.is_intronic)

        #r.5+?
        cdsp.offset = None
        self.assertEqual(str(cdsp), "5+?")
        self.assertTrue(cdsp.is_intronic)

        #r.(5+?)
        cdsp.uncertain = True
        self.assertEqual(str(cdsp), "(5+?)")

        # c.*5

        cdsp = hgvs.location.BaseOffsetPosition(5, datum=Datum.CDS_END)