Ejemplo n.º 1
0
    def test_removeService_unauthorized(self):
        nc = NetworkController()

        nc.truncateServices("AS62ELRB5F0709LERPHZD06JWC0P8QSC")
        nc.addService(
            "AS62ELRB5F0709LERPHZD06JWC0P8QSC", {
                "id": "a",
                "code": "b",
                "provider": "c",
                "member": "d",
                "comment": "e",
                "status": "f",
                "date": "g"
            })
        response = nc.removeService("DDPR0TG8EF760QR2J7IUF3UFIRXXL4E3", "a")
        self.assertEqual(response.error, consts.ERROR_UNAUTHORIZED_OPERATION)

        response = nc.removeService("asd", "a")
        self.assertEqual(response.error, consts.ERROR_UNAUTHORIZED_OPERATION)
Ejemplo n.º 2
0
    def test_removeService_good(self):
        nc = NetworkController()

        nc.truncateServices("AS62ELRB5F0709LERPHZD06JWC0P8QSC")
        nc.addService(
            "AS62ELRB5F0709LERPHZD06JWC0P8QSC", {
                "id": "a",
                "code": "b",
                "provider": "c",
                "member": "d",
                "comment": "e",
                "status": "f",
                "date": "g"
            })
        response = nc.removeService("AS62ELRB5F0709LERPHZD06JWC0P8QSC", "a")
        self.assertEqual(response.error, consts.NO_ERROR)

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