Exemplo n.º 1
0
    def test_load_expects_one_parameter(self):
        error_message = "Invalid command! Try load <number>"

        self.assertEqual(error_message, pizza.load("", [], {}, {}))
        self.assertEqual(error_message, pizza.load("", ["load"], {}, {}))
Exemplo n.º 2
0
    def test_load_reminds_to_save_orders(self):
        expected_string = (
            "You have not saved the current order.\n" "If you wish to discard it, type load <number> again."
        )

        self.assertEqual(expected_string, pizza.load("list", ["load", 2], {}, self.orders))
Exemplo n.º 3
0
    def test_load_works_with_correct_input(self):
        orders = {}

        self.assertTrue(pizza.load("load", ["load", 2], {}, orders))
        self.assertEqual(orders, {"Jane": [15.50], "Jack": [5.00]})
Exemplo n.º 4
0
    def test_load_needs_the_last_command_to_be_list(self):
        input = ["load", "2"]

        self.assertEqual(
            "Use list command before loading", pizza.load("status", input, self.last_saved_state, self.orders)
        )
Exemplo n.º 5
0
    def test_load_needs_valid_number(self):
        error_message = "There is no such file"
        input = ["load", "5"]

        self.assertEqual(error_message, pizza.load("list", input, {}, {}))