From 0eaca266246df604dbb50ffba0a571aa69c31bd7 Mon Sep 17 00:00:00 2001 From: tengzl33t Date: Thu, 2 May 2024 12:54:39 +0300 Subject: [PATCH] fix: pytest --- tests/unit/test_client.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/unit/test_client.py b/tests/unit/test_client.py index 27043de..8538d6c 100644 --- a/tests/unit/test_client.py +++ b/tests/unit/test_client.py @@ -12,6 +12,7 @@ class TestClient(TestCase): """Main API Client test class.""" + @classmethod def setUpClass(cls) -> None: """Setting up Main API Client class for tests.""" @@ -51,11 +52,13 @@ def test_sites_incorrect_command(self): def test_list_sites_incorrect_customer(self): """Test for incorrect customer in payload provided.""" client = Client(self.api_env, self.api_key_prod) - with self.assertRaises(TXAPIResponseError): - client.sites({ - "command": "list", - "customer_name": "fffamogus" - }) + + response = client.sites({ + "command": "list", + "customer_name": "fffamogus" + }) + + assert isinstance(response, TXAPIResponseError) def test_list_sites(self): """Test for 'sites' method 'list' command."""