from solution import Seat, DiscountEngine
def test_seat_states():
print("Running Seat state tests...")
seat = Seat("A1")
assert seat.get_state() == "FREE"
assert seat.lock() is True
assert seat.get_state() == "LOCKED"
assert seat.unlock() is True
assert seat.get_state() == "FREE"
assert seat.book() is True
assert seat.get_state() == "BOOKED"
assert seat.lock() is False
assert seat.unlock() is False
assert seat.book() is False
print("✅ Seat state tests passed")
def test_discount_engine():
print("Running DiscountEngine tests...")
d = DiscountEngine(1000)
assert d.get_price() == 1000
assert d.apply_coupon("SAVE10") is True
assert d.get_price() == 900
assert d.apply_coupon("SAVE10") is False
assert d.apply_coupon("INVALID") is False
assert d.apply_loyalty_discount() is True
assert d.get_price() == 800
assert d.apply_loyalty_discount() is False
d2 = DiscountEngine(50)
assert d2.apply_loyalty_discount() is True
assert d2.get_price() == 0
print("✅ DiscountEngine tests passed")
if __name__ == "__main__":
test_seat_states()
test_discount_engine()
print("\n🎉 ALL DAY 6 TESTS PASSED SUCCESSFULLY")