def test_namedtuple_name_to_class(self): self.assertEqual( schema_io.namedtuple_name_to_class('schema_io_test.NamedTuple1'), NamedTuple1) self.assertEqual( schema_io.namedtuple_name_to_class('schema_io_test.NamedTuple2'), NamedTuple2)
def test_namedtuple_deprecated_name_to_class(self): self.assertEqual( schema_io.namedtuple_name_to_class( 'schema_io_test.DeprecatedNamedTuple1'), NamedTuple1)
def test_namedtuple_name_to_class_not_registered(self): with self.assertRaisesRegex( KeyError, 'Namedtuple name \'blahblah\' is not registered'): schema_io.namedtuple_name_to_class('blahblah')