Esempio n. 1
0
    def test_removeMenuItem_unauthorized(self):
        nc = NetworkController()

        nc.truncateMenu("AS62ELRB5F0709LERPHZD06JWC0P8QSC")
        nc.addMenuItem("AS62ELRB5F0709LERPHZD06JWC0P8QSC", {
            "id": "a",
            "name": "b",
            "fee": "100"
        })
        response = nc.removeMenuItem("DDPR0TG8EF760QR2J7IUF3UFIRXXL4E3", "a")
        self.assertEqual(response.error, consts.ERROR_UNAUTHORIZED_OPERATION)

        response = nc.removeMenuItem("asd", "a")
        self.assertEqual(response.error, consts.ERROR_UNAUTHORIZED_OPERATION)
Esempio n. 2
0
    def test_removeMenuItem_good(self):
        nc = NetworkController()

        nc.truncateMenu("AS62ELRB5F0709LERPHZD06JWC0P8QSC")
        nc.addMenuItem("AS62ELRB5F0709LERPHZD06JWC0P8QSC", {
            "id": "a",
            "name": "b",
            "fee": "100"
        })
        response = nc.removeMenuItem("AS62ELRB5F0709LERPHZD06JWC0P8QSC", "a")
        self.assertEqual(response.error, consts.NO_ERROR)

        response = nc.getMenuItem("AS62ELRB5F0709LERPHZD06JWC0P8QSC", "a")
        self.assertEqual(response.error, consts.ERROR_NONEXISTENT_ENTRY)