from streck import line_to_coordinate
|
EPSILON = 0.001
|
|
def test_line_to_coordinate():
|
line = " 12.4; -5.67 "
|
c = line_to_coordinate(line)
|
x = c["x"]
|
y = c["y"]
|
assert abs(x - 12.4) < EPSILON
|
assert abs(y + 5.67) < EPSILON
|
|
def test_line_to_coordinate_coma_sep():
|
line = " 12,4; -5,67 "
|
c = line_to_coordinate(line)
|
x = c["x"]
|
y = c["y"]
|
assert abs(x - 12.4) < EPSILON
|
assert abs(y + 5.67) < EPSILON
|