Exemplo n.º 1
0
 def test_compile_swapped_coords(self):
     tags = compile_tags(txt2tags("20\n2.2\n10\n1.1"))
     assert tags[0] == (20, 2.2), "expected coords as single tags"
     assert tags[1] == (10, 1.1), "expected coords as single tags"
Exemplo n.º 2
0
 def test_row_count(self, model):
     assert model.rowCount() == len(compile_tags(self.tags()))
Exemplo n.º 3
0
 def test_compile_single_group_code_10(self):
     tags = compile_tags(txt2tags("10\n1.1"))
     assert tags[0] == (10, 1.1)
Exemplo n.º 4
0
 def test_compile_two_group_code_10(self):
     tags = compile_tags(txt2tags("10\n1.1\n10\n2.2"))
     assert tags[0] == (10, 1.1)
     assert tags[1] == (10, 2.2)
Exemplo n.º 5
0
 def test_compile_single_3d_point(self):
     tags = compile_tags(txt2tags("10\n1.2\n20\n2.3\n30\n3.4"))
     assert tags[0] == (10, (1.2, 2.3, 3.4))
Exemplo n.º 6
0
 def test_compile_nan_coords_3d(self):
     tags = compile_tags(txt2tags("10\n1\n20\n2\n30\nx"))
     assert math.isnan(tags[0].value[2])
Exemplo n.º 7
0
 def test_compile_two_2d_points(self):
     tags = compile_tags(txt2tags("10\n1.1\n20\n1.2\n10\n2.1\n20\n2.2"))
     assert tags[0] == (10, (1.1, 1.2))
     assert tags[1] == (10, (2.1, 2.2))
Exemplo n.º 8
0
 def test_compile_nan_coords_2d(self):
     tags = compile_tags(txt2tags("10\nx.2\n20\n2.3"))
     assert math.isnan(tags[0].value[0])
Exemplo n.º 9
0
 def test_compile_single_2d_point(self):
     tags = compile_tags(txt2tags("10\n1.2\n20\n2.3"))
     assert tags[0] == (10, (1.2, 2.3))
Exemplo n.º 10
0
 def test_compile_invalid_float_to_str(self):
     tags = compile_tags(txt2tags("40\nx.14"))
     assert tags[0] == (40, "x.14")
Exemplo n.º 11
0
 def test_compile_single_float(self):
     tags = compile_tags(txt2tags("40\n3.14"))
     assert tags[0] == (40, 3.14)
Exemplo n.º 12
0
 def test_compile_invalid_int_to_str(self):
     tags = compile_tags(txt2tags("70\nx"))
     assert tags[0] == (70, "x")
Exemplo n.º 13
0
 def test_compile_single_int(self):
     tags = compile_tags(txt2tags("70\n3"))
     assert tags[0] == (70, 3)