gaphas/tests/test_connector.py
Dan Yeaw ea298141fc
Restructure project to match modern standard, move docs and tests
Signed-off-by: Dan Yeaw <dan@yeaw.me>
2018-12-25 12:01:33 -05:00

31 lines
578 B
Python

import pytest
from gaphas.connector import Position, Handle
from gaphas.solver import Variable
@pytest.mark.parametrize("position", [(0, 0), (1, 2)])
def test_position(position):
pos = Position(position)
assert position[0] == pos.x
assert position[1] == pos.y
def test_set_xy():
pos = Position((1, 2))
x = Variable()
y = Variable()
assert x is not pos.x
assert y is not pos.y
pos.set_x(x)
pos.set_y(y)
assert x is pos.x
assert y is pos.y
def test_handle_x_y():
h = Handle()
assert 0.0 == h.x
assert 0.0 == h.y