def test_happy_path(self): try: parsers.KeyExtensionInterface("0") parsers.KeyExtensionInterface("113") parsers.KeyExtensionInterface("2w") parsers.KeyExtensionInterface("3m") parsers.KeyExtensionInterface("54y") except UsageError: self.fail( 'more than one digit, key extension option, raises exceptions')
def test_more_than_y_is_not_allowed_option(self): with self.assertRaises(UsageError): parsers.KeyExtensionInterface("9yy")
def test_letters_before_a_number_is_not_allowed(self): with self.assertRaises(UsageError): parsers.KeyExtensionInterface("w3")
def test_negative_number_is_not_allowed(self): with self.assertRaises(UsageError): parsers.KeyExtensionInterface("-1")
def test_anything_that_is_not_w_y_m_is_not_allowed(self): with self.assertRaises(UsageError): parsers.KeyExtensionInterface("2x")