Add test for listing carriers and assert that at least one carrier has a code equal to "gls".

- Add test for listing carriers
- Assert that at least one carrier has a code equal to "gls"
This commit is contained in:
Kumi 2023-08-31 09:03:57 +02:00
parent f53c41c99f
commit fbb1a9d46c
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -34,5 +34,9 @@ class TestKeyDelivery(TestCase):
response = self.keydelivery.realtime("gls", "483432314669")
self.assertEqual(response["code"], 200)
def test_list_carriers(self):
response = self.keydelivery.list_carriers()
self.assertTrue(any([carrier["code"] == "gls" for carrier in response["data"]]))
if __name__ == "__main__":
main()