예제 #1
0
    def test_04(self):
        inventory = {"chickens": 5, "cows": 2, "pigs": 9}

        transaction = ("sell", "cows", 0)

        expected = {"chickens": 5, "cows": 2, "pigs": 9}

        lab.warehouse_process(inventory, transaction)
        self.assertEqual(inventory, expected)
예제 #2
0
    def test_03(self):
        inventory = {"chickens": 5, "cows": 2, "pigs": 9}

        transaction = ("buy", "lambs", 18)

        expected = {"chickens": 5, "cows": 2, "pigs": 9, "lambs": 18}

        lab.warehouse_process(inventory, transaction)
        self.assertEqual(inventory, expected)
예제 #3
0
    def test_05(self):
        inventory = {"chickens": 5, "cows": 2, "pigs": 9}

        transaction = ("sell", "cows", 7)

        try:
            lab.warehouse_process(inventory, transaction)
        except ValueError:
            self.assertTrue(True)
        except:
            self.assertTrue(False)