# Path: hgvs/enums.py

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


import unittest
import pytest
import hgvs.edit
import hgvs.location
from hgvs.enums import Datum
from hgvs.exceptions import HGVSError
from __future__ import absolute_import, division, print_function, unicode_literals





@pytest.mark.quick
@pytest.mark.models
class Test_Edit(unittest.TestCase):
    def test_NARefAlt_exceptions(self):
        with self.assertRaises(HGVSError):
            edit = str(hgvs.edit.NARefAlt(None, None))

    def test_NARefAlt(self):
        self.assertEqual(hgvs.edit.NARefAlt("A", "A").format(conf={'max_ref_length': None}), "A=")
        self.assertEqual(hgvs.edit.NARefAlt("A", "T").format(conf={'max_ref_length': None}), "A>T")
        self.assertEqual(
            hgvs.edit.NARefAlt("AA", None).format(conf={'max_ref_length': None}), "delAA")
        self.assertEqual(
            hgvs.edit.NARefAlt(None, "TT").format(conf={'max_ref_length': None}), "insTT")
        self.assertEqual(
            hgvs.edit.NARefAlt("AA", "T").format(conf={'max_ref_length': None}), "delAAinsT")
        self.assertEqual(
            hgvs.edit.NARefAlt("A", "TT").format(conf={'max_ref_length': None}), "delAinsTT")
        # edit types
        self.assertEqual(str(hgvs.edit.NARefAlt("A", "A").type), "identity")
        self.assertEqual(str(hgvs.edit.NARefAlt("A", "T").type), "sub")
        self.assertEqual(str(hgvs.edit.NARefAlt("AA", None).type), "del")
        self.assertEqual(str(hgvs.edit.NARefAlt(None, "TT").type), "ins")
        self.assertEqual(str(hgvs.edit.NARefAlt("AA", "T").type), "delins")

# Path: hgvs/enums.py

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


# Path: tests/test_hgvs_edit.py
import unittest
import pytest
import hgvs.edit
import hgvs.location
from hgvs.enums import Datum
from hgvs.exceptions import HGVSError

from __future__ import absolute_import, division, print_function, unicode_literals





@pytest.mark.quick
@pytest.mark.models
class Test_Edit(unittest.TestCase):
    def test_NARefAlt_exceptions(self):
        with self.assertRaises(HGVSError):
            edit = str(hgvs.edit.NARefAlt(None, None))

    def test_NARefAlt(self):
        self.assertEqual(hgvs.edit.NARefAlt("A", "A").format(conf={'max_ref_length': None}), "A=")
        self.assertEqual(hgvs.edit.NARefAlt("A", "T").format(conf={'max_ref_length': None}), "A>T")
        self.assertEqual(
            hgvs.edit.NARefAlt("AA", None).format(conf={'max_ref_length': None}), "delAA")
        self.assertEqual(
            hgvs.edit.NARefAlt(None, "TT").format(conf={'max_ref_length': None}), "insTT")
        self.assertEqual(
            hgvs.edit.NARefAlt("AA", "T").format(conf={'max_ref_length': None}), "delAAinsT")
        self.assertEqual(
            hgvs.edit.NARefAlt("A", "TT").format(conf={'max_ref_length': None}), "delAinsTT")
        # edit types
        self.assertEqual(str(hgvs.edit.NARefAlt("A", "A").type), "identity")
        self.assertEqual(str(hgvs.edit.NARefAlt("A", "T").type), "sub")
        self.assertEqual(str(hgvs.edit.NARefAlt("AA", None).type), "del")
        self.assertEqual(str(hgvs.edit.NARefAlt(None, "TT").type), "ins")
        self.assertEqual(str(hgvs.edit.NARefAlt("AA", "T").type), "delins")

        self.assertEqual(str(hgvs.edit.NARefAlt("A", "TT").type), "delins")