Exemple #1
0
    def test_truncateMenuItems_good(self):
        nc = NetworkController()
        key = "AS62ELRB5F0709LERPHZD06JWC0P8QSC"

        response = nc.truncateMenu(key)
        self.assertEqual(response.error, consts.NO_ERROR)

        response = nc.getAllMenuItems(key)
        self.assertEqual(response.error, consts.NO_ERROR)
        self.assertEqual(len(response.payload), 0)
Exemple #2
0
    def test_addMenuItem_good(self):
        nc = NetworkController()
        data = {"id": "a", "name": "b", "fee": "100"}

        nc.truncateMenu("AS62ELRB5F0709LERPHZD06JWC0P8QSC")
        response = nc.addMenuItem("AS62ELRB5F0709LERPHZD06JWC0P8QSC", data)
        self.assertEqual(response.error, consts.NO_ERROR)

        response = nc.getAllMenuItems("AS62ELRB5F0709LERPHZD06JWC0P8QSC")
        self.assertEqual(response.error, consts.NO_ERROR)
        self.assertEqual(len(response.payload), 1)
        self.assertEqual(response.payload[0], {
            "id": "a",
            "name": "b",
            "fee": "100"
        })