Skip to content

Commit 2628217

Browse files
authored
fix unit tests data tree (#896)
1 parent 41ec37b commit 2628217

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tests/test_data_tree.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,11 @@ def test_get_as_data_tree(server_type):
9797
to_fill.list_double = [1.5, 2.5]
9898
to_fill.list_string = ["hello", "bye"]
9999
assert data_tree.get_as("int") == "1"
100-
assert data_tree.get_as("double") == "1.000000"
100+
assert float(data_tree.get_as("double")) == 1.0
101101
assert data_tree.get_as("string") == "hello"
102102
assert data_tree.get_as("list_int") == "1;2"
103-
assert data_tree.get_as("list_double") == "1.500000;2.500000"
103+
assert float(data_tree.get_as("list_double").split(";")[0]) == 1.5
104+
assert float(data_tree.get_as("list_double").split(";")[1]) == 2.50000
104105
assert data_tree.get_as("list_string") == "hello;bye"
105106
assert data_tree.get_as("int", dpf.types.int) == 1
106107
assert data_tree.get_as("double", dpf.types.double) == 1.0
@@ -127,7 +128,8 @@ def test_write_data_tree():
127128
assert "list_double" in txt
128129
assert "list_string" in txt
129130
assert "hello;bye" in txt
130-
assert "1.500000;2.500000" in txt
131+
assert "1.5" in txt
132+
assert "2.5" in txt
131133
txt = data_tree.write_to_json()
132134
assert "int" in txt
133135
assert "double" in txt
@@ -136,7 +138,8 @@ def test_write_data_tree():
136138
assert "list_double" in txt
137139
assert "list_string" in txt
138140
assert "hello;bye" in txt
139-
assert "1.500000;2.500000" in txt
141+
assert "1.5" in txt
142+
assert "2.5" in txt
140143

141144

142145
@conftest.raises_for_servers_version_under("4.0")

0 commit comments

Comments
 (0)