예제 #1
0
 def test_type_int(self):
     assert syntax.datatype(1) == int
예제 #2
0
 def test_type_float(self):
     assert syntax.datatype(1.0) == float
예제 #3
0
 def test_type_dictionary(self):
     assert syntax.datatype({"a": 1, "b": 2}) == dict
예제 #4
0
 def test_type_none(self):
     assert syntax.datatype(None) == type(None)
예제 #5
0
 def test_type_list(self):
     assert syntax.datatype(["a", 1]) == list
예제 #6
0
 def test_type_set(self):
     assert syntax.datatype({"a", "b"}) == set
예제 #7
0
 def test_type_tuple(self):
     assert syntax.datatype(("a", 1)) == tuple
예제 #8
0
 def test_type_bool(self):
     assert syntax.datatype(True) == bool
예제 #9
0
 def test_type_string_multi(self):
     assert syntax.datatype("string") == str
예제 #10
0
 def test_type_string(self):
     assert (syntax.datatype("""multi
             line
             string""") == str)
예제 #11
0
 def test_type_complex(self):
     assert syntax.datatype(1j) == complex