Skip to content

Commit

Permalink
Tests: Corrected tests to use basic assert checks deepskies#141
Browse files Browse the repository at this point in the history
  • Loading branch information
voetberg committed Sep 24, 2024
1 parent 1e2ea05 commit efad3bd
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions tests/shape_generator_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def test_patch_conversion_defaults():
image=simple_patch
)
expected_obj_type = np.array([0, 0])
assert type(converted_object) == type(expected_obj_type)
assert isinstance(converted_object, type(expected_obj_type))


def test_patch_conversion_default_dimensions():
Expand Down Expand Up @@ -202,15 +202,15 @@ def test_polygon_positive_oob_angle():
triangle_rotated = ShapeGenerator().create_regular_polygon(angle=angle + 360)
triangle_non_rotated = ShapeGenerator().create_regular_polygon(angle=angle)

assert (triangle_rotated.all(), triangle_non_rotated.all())
assert triangle_rotated.all() == triangle_non_rotated.all()


def test_polygon_negative_oob_angle():
angle = 45
triangle_rotated = ShapeGenerator().create_regular_polygon(angle=angle - 360)
triangle_non_rotated = ShapeGenerator().create_regular_polygon(angle=angle)

assert (triangle_rotated.all(), triangle_non_rotated.all())
assert triangle_rotated.all() == triangle_non_rotated.all()


def test_polygon_negative_vertices():
Expand All @@ -223,8 +223,8 @@ def test_arc_default():

x, y = arc.shape
expected_x, expected_y = (28, 28)
assert (x, expected_x)
assert (y, expected_y)
assert x == expected_x
assert y == expected_y


def test_arc_size_center_dim_mismatch():
Expand Down Expand Up @@ -253,15 +253,15 @@ def test_arc_oob_negative_theta2():
arc_rotated = ShapeGenerator().create_arc(theta2=angle - 360)
arc_non_rotated = ShapeGenerator().create_arc(theta2=angle)

assert (arc_rotated.all(), arc_non_rotated.all())
assert arc_rotated.all() == arc_non_rotated.all()


def test_arc_oob_positive_theta2():
angle = 45
arc_rotated = ShapeGenerator().create_arc(theta2=angle + 360)
arc_non_rotated = ShapeGenerator().create_arc(theta2=angle)

assert (arc_rotated.all(), arc_non_rotated.all())
assert arc_rotated.all() == arc_non_rotated.all()


def test_arc_oob_width():
Expand All @@ -283,11 +283,11 @@ def test_line_defaults():
assert y == expected_y

# Bottom left top right are black. Opposite are white
assert (1.0 == line[1, 2], "line start incorrect")
assert (1.0 == line[26, 27], "line end incorrect")
assert 1.0 == line[1, 2], "line start incorrect"
assert 1.0 == line[26, 27], "line end incorrect"

assert (0.0 == line[1, 27], "line corner incorrect")
assert (0.0 == line[27, 1], "line corner incorrect")
assert 0.0 == line[1, 27], "line corner incorrect"
assert 0.0 == line[27, 1], "line corner incorrect"


def test_line_size_start_dim_mismatch():
Expand Down

0 comments on commit efad3bd

Please sign in to comment.