From a1da7796c4717fef9b97245926c49b60f460c292 Mon Sep 17 00:00:00 2001 From: Alex Lushpai Date: Wed, 19 Feb 2020 15:28:27 +0300 Subject: [PATCH] fix tests --- .travis.yml | 1 + tests/v3_tests.py | 2 +- tests/v4_tests.py | 2 +- tests/v5_tests.py | 29 +---------------------------- 4 files changed, 4 insertions(+), 30 deletions(-) diff --git a/.travis.yml b/.travis.yml index 336824d..6854e61 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ python: - '3.4' - '3.5' - '3.6' + - '3.7' before_install: - pip install -r requirements.txt script: diff --git a/tests/v3_tests.py b/tests/v3_tests.py index ba73983..39b34e0 100644 --- a/tests/v3_tests.py +++ b/tests/v3_tests.py @@ -30,7 +30,7 @@ class TestVersion3(unittest.TestCase): 'https://epoqwieqwpoieqpwoeiqpwoeiq.retailcrm.ru', '98sdf9sj8fsd9fjs9dfjs98') response = client.statistic_update() - self.assertTrue(response.is_successful(), False) + self.assertIsNot(response.is_successful(), True) self.assertEqual(response.get_error_msg(), 'Account does not exist.') def test_wrong_api_key(self): diff --git a/tests/v4_tests.py b/tests/v4_tests.py index b444819..87a3c27 100644 --- a/tests/v4_tests.py +++ b/tests/v4_tests.py @@ -30,7 +30,7 @@ class TestVersion4(unittest.TestCase): 'https://epoqwieqwpoieqpwoeiqpwoeiq.retailcrm.ru', '98sdf9sj8fsd9fjs9dfjs98') response = client.statistic_update() - self.assertTrue(response.is_successful(), False) + self.assertIsNot(response.is_successful(), True) self.assertEqual(response.get_error_msg(), 'Account does not exist.') def test_wrong_api_key(self): diff --git a/tests/v5_tests.py b/tests/v5_tests.py index ce27af9..03eef87 100644 --- a/tests/v5_tests.py +++ b/tests/v5_tests.py @@ -30,7 +30,7 @@ class TestVersion5(unittest.TestCase): 'https://epoqwieqwpoieqpwoeiqpwoeiq.retailcrm.ru', '98sdf9sj8fsd9fjs9answer98') response = client.statistic_update() - self.assertTrue(response.is_successful(), False) + self.assertIsNot(response.is_successful(), True) self.assertEqual(response.get_error_msg(), 'Account does not exist.') def test_wrong_api_key(self): @@ -67,33 +67,6 @@ class TestVersion5(unittest.TestCase): self.assertTrue(response.is_successful(), True) - # def test_telephony_calls_upload(self): - # """ - # V5 Test telephony calls upload - # """ - # - # calls = [ - # { - # 'date': '2018-04-20 22:10:00', - # 'type': 'in', - # 'phone': '+79999999999', - # 'userId': os.getenv('RETAILCRM_USER'), - # 'result': 'answered' - # }, - # { - # 'date': '2018-04-20 22:10:00', - # 'type': 'out', - # 'phone': '+79999999999', - # 'userId': os.getenv('RETAILCRM_USER'), - # 'result': 'answered' - # } - # ] - # - # response = self.client.telephony_calls_upload(calls) - # - # self.assertTrue(response.is_successful(), True) - # self.assertTrue(response.get_status_code() < 400, True) - def test_set_user_status(self): response = self.client.user_status(os.getenv('RETAILCRM_USER'), 'dinner')