def test_complex(self): source = { 'typename': '%s.%s' % (Tester.__module__, Tester.__name__), 'foo': {'datatype': RecurseTest, 'foo': 'bar', 'color': 'red'}, 'bing': 'bang', } expected = { 'datatype': Tester, 'foo': {'datatype': RecurseTest, 'foo': 'bar', 'color': COLORS.Red}, 'bing': 'post-bang', } actual = recurse.recurse(source, post='post_recursion') self.assertEqual(expected, actual)
def test_complex(self): source = { 'typename': '%s.%s' % (Tester.__module__, Tester.__name__), 'foo': { 'datatype': RecurseTest, 'foo': 'bar', 'color': 'red' }, 'bing': 'bang', } expected = { 'datatype': Tester, 'foo': { 'datatype': RecurseTest, 'foo': 'bar', 'color': COLORS.Red }, 'bing': 'post-bang', } actual = recurse.recurse(source, post='post_recursion') self.assertEqual(expected, actual)
def test_simple(self): source = {'datatype': RecurseTest, 'foo': 'bar', 'color': 'red'} expected = {'datatype': RecurseTest, 'foo': 'bar', 'color': COLORS.Red} actual = recurse.recurse(source, post='post_recursion') self.assertEqual(expected, actual)
def test_trivial(self): self.assertEqual(recurse.recurse({'a': {}}), {'a': {}})
def test_empty(self): self.assertEqual(recurse.recurse({}), {})