Beispiel #1
0
    def test_addProvider_good(self):
        nc = NetworkController()
        data = {
            "id": "a",
            "name": "b",
            "address": "c",
            "city": "d",
            "state": "e",
            "zip": "f"
        }

        nc.truncateProviders("AS62ELRB5F0709LERPHZD06JWC0P8QSC")
        response = nc.addProvider("AS62ELRB5F0709LERPHZD06JWC0P8QSC", data)
        self.assertEqual(response.error, consts.NO_ERROR)

        response = nc.getAllProviders("AS62ELRB5F0709LERPHZD06JWC0P8QSC")
        self.assertEqual(response.error, consts.NO_ERROR)
        self.assertEqual(len(response.payload), 1)
        self.assertEqual(
            response.payload[0], {
                "id": "a",
                "name": "b",
                "address": "c",
                "city": "d",
                "state": "e",
                "zip": "f"
            })
Beispiel #2
0
    def test_truncateProviders_good(self):
        nc = NetworkController()
        key = "AS62ELRB5F0709LERPHZD06JWC0P8QSC"

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

        response = nc.getAllProviders(key)
        self.assertEqual(response.error, consts.NO_ERROR)
        self.assertEqual(len(response.payload), 0)