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


import os
import unittest
import pytest
import hgvs.dataproviders.uta
import hgvs.parser
import hgvs.variantmapper
from hgvs.exceptions import HGVSUnsupportedOperationError
from support import CACHE
    #See #319:: ("NM_000249.3:c.1897-3_1897-1delinsACGT", ),

    # identity variants:
        ("NM_000314.4:c.1=", 0),
        ("NM_000314.4:c.1C=", 0),
        ("NM_000314.4:c.1_2CC=", 0),
        ("NM_000314.4:c.1_2delinsCC", 0),
    ]

    error_tests = [
        "NM_003777.3:c.13552_*36del57",
    ]

    @classmethod
    def setUpClass(cls):
        cls.hdp = hgvs.dataproviders.uta.connect(
            mode=os.environ.get("HGVS_CACHE_MODE", "run"), cache=CACHE)
        cls.vm = hgvs.variantmapper.VariantMapper(cls.hdp)
        cls.hp = hgvs.parser.Parser()

    def test_success_cases(self):
        "posedit length_change: test supported variant types"
        for tv, tl in self.success_tests:
            v = self.hp.parse_hgvs_variant(tv)
            self.assertEqual(v.posedit.length_change(), tl)

    def test_error_cases_w_exceptions(self):
        "posedit length_change: raise exception on error"
        for tv in self.error_tests:
            v = self.hp.parse_hgvs_variant(tv)

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


# Path: tests/fx-test/test_variant_length.py
import os
import unittest
import pytest
import hgvs.dataproviders.uta
import hgvs.parser
import hgvs.variantmapper
from hgvs.exceptions import HGVSUnsupportedOperationError
from support import CACHE

    #See #319:: ("NM_000249.3:c.1897-3_1897-1delinsACGT", ),

    # identity variants:
        ("NM_000314.4:c.1=", 0),
        ("NM_000314.4:c.1C=", 0),
        ("NM_000314.4:c.1_2CC=", 0),
        ("NM_000314.4:c.1_2delinsCC", 0),
    ]

    error_tests = [
        "NM_003777.3:c.13552_*36del57",
    ]

    @classmethod
    def setUpClass(cls):
        cls.hdp = hgvs.dataproviders.uta.connect(
            mode=os.environ.get("HGVS_CACHE_MODE", "run"), cache=CACHE)
        cls.vm = hgvs.variantmapper.VariantMapper(cls.hdp)
        cls.hp = hgvs.parser.Parser()

    def test_success_cases(self):
        "posedit length_change: test supported variant types"
        for tv, tl in self.success_tests:
            v = self.hp.parse_hgvs_variant(tv)
            self.assertEqual(v.posedit.length_change(), tl)

    def test_error_cases_w_exceptions(self):
        "posedit length_change: raise exception on error"
        for tv in self.error_tests:
            v = self.hp.parse_hgvs_variant(tv)

            with self.assertRaises(HGVSUnsupportedOperationError):