draw_shape turns 360 divided by the number of sides after each side and rejects fewer than 3 sides. draw_shapes draws a triangle up to a decagon, each in a color from the palette. Task: MIL-003#3 Task: MIL-003#4 Task: MIL-003#5
20 lines
609 B
Python
20 lines
609 B
Python
from turtle_challenges import constants
|
|
|
|
|
|
def test_color_mode_matches_the_largest_channel_value() -> None:
|
|
assert constants.COLOR_MODE == constants.COLOR_CHANNEL_MAX == 255
|
|
|
|
|
|
def test_challenge_names_are_unique() -> None:
|
|
assert len(set(constants.CHALLENGE_NAMES)) == len(constants.CHALLENGE_NAMES)
|
|
|
|
|
|
def test_palette_has_only_non_empty_names() -> None:
|
|
assert constants.COLOR_PALETTE
|
|
assert all(name for name in constants.COLOR_PALETTE)
|
|
|
|
|
|
def test_polygon_range_runs_from_triangle_to_decagon() -> None:
|
|
assert constants.MIN_POLYGON_SIDES == 3
|
|
assert constants.MAX_POLYGON_SIDES == 10
|