def test_intersect_rotate_down(): cart = Cart(0, 0, "v") cart.intersect_rotate() assert_equal(cart.get_direction(), ">", "expected cart to have turned left") cart.intersect_rotate() assert_equal(cart.get_direction(), ">", "expected cart not to have turned") cart.intersect_rotate() assert_equal(cart.get_direction(), "v", "expected cart to have turned right") cart.intersect_rotate() assert_equal(cart.get_direction(), ">", "expected cart to have turned left")
def test_turn_rotate_down_backward(): cart = Cart(0, 0, "v") cart.turn_rotate("\\") assert_equal(cart.get_direction(), ">")
def test_turn_rotate_down_forward(): cart = Cart(0, 0, "v") cart.turn_rotate("/") assert_equal(cart.get_direction(), "<")
def test_turn_rotate_right_forward(): cart = Cart(0, 0, ">") cart.turn_rotate("/") assert_equal(cart.get_direction(), "^")
def test_turn_rotate_left_backward(): cart = Cart(0, 0, "<") cart.turn_rotate("\\") assert_equal(cart.get_direction(), "^")