コード例 #1
0
 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)
コード例 #2
0
 def test_namedtuple_deprecated_name_to_class(self):
     self.assertEqual(
         schema_io.namedtuple_name_to_class(
             'schema_io_test.DeprecatedNamedTuple1'), NamedTuple1)
コード例 #3
0
 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')