# Path: hgvs/exceptions.py
# class HGVSInvalidVariantError(HGVSError):
#     """Exception raised when variant is inconsistent or invalid"""
#     pass


import os
import unittest
import pytest
import hgvs.dataproviders.uta
import hgvs.parser
import hgvs.variantmapper
import hgvs.assemblymapper
from hgvs.exceptions import HGVSInvalidVariantError
from support import CACHE
from __future__ import absolute_import, division, print_function, unicode_literals






@pytest.mark.quick
class Test_VariantMapper(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        cls.hdp = hgvs.dataproviders.uta.connect(
            mode=os.environ.get("HGVS_CACHE_MODE", "run"), cache=CACHE)
        cls.am = hgvs.assemblymapper.AssemblyMapper(cls.hdp)
        cls.am37 = hgvs.assemblymapper.AssemblyMapper(cls.hdp, assembly_name="GRCh37")
        cls.hp = hgvs.parser.Parser()

    def test_VariantMapper_quick(self):
        # From garcia.tsv:
        hgvs_g = "NC_000007.13:g.36561662C>T"
        hgvs_c = "NM_001637.3:c.1582G>A"
        hgvs_p = "NP_001628.1:p.(Gly528Arg)"

        var_g = self.hp.parse_hgvs_variant(hgvs_g)
        var_c = self.am.g_to_c(var_g, "NM_001637.3")
        var_p = self.am.c_to_p(var_c)

        self.assertEqual(str(var_c), hgvs_c)
        self.assertEqual(str(var_p), hgvs_p)


# Path: hgvs/exceptions.py
# class HGVSInvalidVariantError(HGVSError):
#     """Exception raised when variant is inconsistent or invalid"""
#     pass


# Path: tests/test_hgvs_assemblymapper.py
import os
import unittest
import pytest
import hgvs.dataproviders.uta
import hgvs.parser
import hgvs.variantmapper
import hgvs.assemblymapper
from hgvs.exceptions import HGVSInvalidVariantError
from support import CACHE

from __future__ import absolute_import, division, print_function, unicode_literals






@pytest.mark.quick
class Test_VariantMapper(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        cls.hdp = hgvs.dataproviders.uta.connect(
            mode=os.environ.get("HGVS_CACHE_MODE", "run"), cache=CACHE)
        cls.am = hgvs.assemblymapper.AssemblyMapper(cls.hdp)
        cls.am37 = hgvs.assemblymapper.AssemblyMapper(cls.hdp, assembly_name="GRCh37")
        cls.hp = hgvs.parser.Parser()

    def test_VariantMapper_quick(self):
        # From garcia.tsv:
        hgvs_g = "NC_000007.13:g.36561662C>T"
        hgvs_c = "NM_001637.3:c.1582G>A"
        hgvs_p = "NP_001628.1:p.(Gly528Arg)"

        var_g = self.hp.parse_hgvs_variant(hgvs_g)
        var_c = self.am.g_to_c(var_g, "NM_001637.3")
        var_p = self.am.c_to_p(var_c)

        self.assertEqual(str(var_c), hgvs_c)
        self.assertEqual(str(var_p), hgvs_p)


        with self.assertRaises(HGVSInvalidVariantError):