# 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.variantmapper
import hgvs.parser
import hgvs.validator
from hgvs.exceptions import HGVSInvalidVariantError
from support import CACHE
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals





hdp = hgvs.dataproviders.uta.connect(mode=os.environ.get("HGVS_CACHE_MODE", "run"), cache=CACHE)


class Test_HGVSValidator(unittest.TestCase):
    """Validator wrapper class tests (most testing is handled by the component classes)"""

    @classmethod
    def setUp(cls):
        cls.hp = hgvs.parser.Parser()
        cls.vr = hgvs.validator.Validator(hdp)

    def test_wrapper(self):
        """Test that validator wrapper is working"""
        self.assertTrue(self.vr.validate(self.hp.parse_hgvs_variant("NM_001005405.2:c.6C>A")))
        self.assertTrue(self.vr.validate(self.hp.parse_hgvs_variant("NP_000305.3:p.?")))
        self.assertTrue(self.vr.validate(self.hp.parse_hgvs_variant("NP_000542.1:p.Asn131Ser")))

    def test_not_strict_mode(self):
        """Test that validator is working when in not strict mode"""
        self.assertTrue(
            self.vr.validate(
                self.hp.parse_hgvs_variant("NM_000030.2:c.679_680+2delAAGT"), strict=False))

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


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

# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals





hdp = hgvs.dataproviders.uta.connect(mode=os.environ.get("HGVS_CACHE_MODE", "run"), cache=CACHE)


class Test_HGVSValidator(unittest.TestCase):
    """Validator wrapper class tests (most testing is handled by the component classes)"""

    @classmethod
    def setUp(cls):
        cls.hp = hgvs.parser.Parser()
        cls.vr = hgvs.validator.Validator(hdp)

    def test_wrapper(self):
        """Test that validator wrapper is working"""
        self.assertTrue(self.vr.validate(self.hp.parse_hgvs_variant("NM_001005405.2:c.6C>A")))
        self.assertTrue(self.vr.validate(self.hp.parse_hgvs_variant("NP_000305.3:p.?")))
        self.assertTrue(self.vr.validate(self.hp.parse_hgvs_variant("NP_000542.1:p.Asn131Ser")))

    def test_not_strict_mode(self):
        """Test that validator is working when in not strict mode"""
        self.assertTrue(
            self.vr.validate(
                self.hp.parse_hgvs_variant("NM_000030.2:c.679_680+2delAAGT"), strict=False))

        with self.assertRaises(HGVSInvalidVariantError):