示例#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