Beispiel #1
0
 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)
         })
Beispiel #2
0
 def test_list(self):
     self.assertEquals(
         shape.calculate_shape({'foo': ["one", "two", "three"]}),
         {'foo': [str]})
Beispiel #3
0
 def test_tuple(self):
     self.assertEquals(shape.calculate_shape({'bar': (1, "hello", True)}),
                       {'bar': (int, str, bool)})
Beispiel #4
0
 def test_simple(self):
     self.assertEquals(shape.calculate_shape(1), int)
Beispiel #5
0
 def test_dict(self):
     self.assertEquals(shape.calculate_shape({'hello': 'world'}),
                       {'hello': str})
Beispiel #6
0
 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)}) 
Beispiel #7
0
 def test_tuple(self):
     self.assertEquals(
         shape.calculate_shape({'bar': (1, "hello", True)}),
         {'bar': (int, str, bool)})
Beispiel #8
0
 def test_list(self):
     self.assertEquals(
         shape.calculate_shape({'foo': ["one", "two", "three"]}),
         {'foo': [str]})
Beispiel #9
0
 def test_dict(self):
     self.assertEquals(
         shape.calculate_shape({'hello': 'world'}),
         {'hello': str})
Beispiel #10
0
 def test_simple(self):
     self.assertEquals(shape.calculate_shape(1), int)