def test_converter_path(self):
with self.assertRaisesRegexp(Exception, 'No such validator foo/bar'):
converter_path(Validator('foo', 'bar'), Validator('foo', 'baz'))
# There is no path for types which lie in different components
with self.assertRaises(NetworkXNoPath):
converter_path(self.stringTextValidator,
Validator('graph', 'networkx'))
self.assertEquals(converter_path(self.stringTextValidator,
self.stringTextValidator), [])
# There is a two-step path converting between these types
self.assertEquals(len(converter_path(self.stringTextValidator,
Validator('string', 'json'))), 2)
评论列表
文章目录