def test_nest(self): self.assertEquals( shape.calculate_shape({ 'foo': [{ 'bar': 1 }, { 'bar': 2 }], 'baz': ({ 'bamf': 'hello' }, 5) }), { 'foo': [{ 'bar': int }], 'baz': ({ 'bamf': str }, int) })
def test_list(self): self.assertEquals( shape.calculate_shape({'foo': ["one", "two", "three"]}), {'foo': [str]})
def test_tuple(self): self.assertEquals(shape.calculate_shape({'bar': (1, "hello", True)}), {'bar': (int, str, bool)})
def test_simple(self): self.assertEquals(shape.calculate_shape(1), int)
def test_dict(self): self.assertEquals(shape.calculate_shape({'hello': 'world'}), {'hello': str})
def test_nest(self): self.assertEquals( shape.calculate_shape( {'foo': [{'bar': 1}, {'bar': 2}], 'baz': ({'bamf': 'hello'}, 5)}), {'foo': [{'bar': int}], 'baz': ({'bamf': str}, int)})
def test_tuple(self): self.assertEquals( shape.calculate_shape({'bar': (1, "hello", True)}), {'bar': (int, str, bool)})
def test_dict(self): self.assertEquals( shape.calculate_shape({'hello': 'world'}), {'hello': str})