From c631505a7a3ed30ae42815497f42575e8d60ceb8 Mon Sep 17 00:00:00 2001 From: Luiko Czub Date: Mon, 24 Nov 2014 22:17:03 +0100 Subject: [PATCH 1/4] py33 and py34 development by manojkml --- CHANGES.rst | 4 ++-- README.rst | 5 +++-- src/testlink/version.py | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 1c580b7..38721e9 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,8 +1,8 @@ Changes in TestLink-API-Python-client Source Distribution ========================================================= -TestLink-API-Python-client release notes v0.6 (Nov. 2014) ---------------------------------------------------------- +TestLink-API-Python-client release notes v0.6.0 - under develop +--------------------------------------------------------------- support for python 3 (3.3 and 3.4) added tox, pytest and travis for tests and ci diff --git a/README.rst b/README.rst index ad2609f..97e25cb 100644 --- a/README.rst +++ b/README.rst @@ -81,7 +81,7 @@ how existing code can be adapted TestLink-API-Python-client developers ------------------------------------- -* `James Stock`_, `Olivier Renault`_, `lczub`_ +* `James Stock`_, `Olivier Renault`_, `lczub`_, `manojklm`_ (PY3) * `g4l4drim`_, `pade`_, `anton-matosov`_, `citizen-stig`_, `charz`_ * anyone forgotten? @@ -102,4 +102,5 @@ TestLink-API-Python-client developers .. _lczub: https://github.com/lczub/TestLink-API-Python-client .. _anton-matosov: https://github.com/anton-matosov/TestLink-API-Python-client .. _citizen-stig: https://github.com/citizen-stig/TestLink-API-Python-client -.. _charz: https://github.com/charz/TestLink-API-Python-client.git \ No newline at end of file +.. _charz: https://github.com/charz/TestLink-API-Python-client.git +.. _manojklm: https://github.com/manojklm/TestLink-API-Python-client \ No newline at end of file diff --git a/src/testlink/version.py b/src/testlink/version.py index d4a93d9..054768f 100644 --- a/src/testlink/version.py +++ b/src/testlink/version.py @@ -17,6 +17,6 @@ # # ------------------------------------------------------------------------ -VERSION = '0.6' +VERSION = '0.6.0-dev' TL_RELEASE = '1.9.12' From 1ad9e4f86a7af2d35092e1c07b69737533d152ce Mon Sep 17 00:00:00 2001 From: mk Date: Wed, 26 Nov 2014 18:30:35 +0530 Subject: [PATCH 2/4] Fix for accidental revert b3fb456 Tests pass in py26 py27 py33 py34 Offline tests - 125 Online tests - 136 --- test/test.py | 1 + test/utest-offline/testlinkapi_offline_test.py | 17 ++++++++--------- .../testlinkapigeneric_offline_test.py | 3 +-- test/utest-offline/testlinkargs_test.py | 3 +-- test/utest-offline/testlinkdecorators_test.py | 3 +-- test/utest-offline/testlinkhelper_test.py | 3 +-- .../testlinkapi_generic_online_test.py | 3 +-- test/utest-online/testlinkapi_online_test.py | 3 +-- 8 files changed, 15 insertions(+), 21 deletions(-) diff --git a/test/test.py b/test/test.py index 9308948..20c4e54 100644 --- a/test/test.py +++ b/test/test.py @@ -30,6 +30,7 @@ ''' Fichier de test pour le module "TestLinkAPI.py" ''' +raise NotImplementedError("these tests are deprecated, please use unit test from test/utest") import re from testlink import TestLink, TestLinkError, TestLinkHelper diff --git a/test/utest-offline/testlinkapi_offline_test.py b/test/utest-offline/testlinkapi_offline_test.py index d189fcc..b306082 100644 --- a/test/utest-offline/testlinkapi_offline_test.py +++ b/test/utest-offline/testlinkapi_offline_test.py @@ -27,8 +27,7 @@ from testlink.testlinkerrors import TLArgError if sys.version_info[0] < 3: - if sys.version_info[1] < 7: - import unittest2 as unittest + import unittest2 as unittest unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp # scenario_a includes response from a testlink 1.9.3 server @@ -524,17 +523,17 @@ def test_whatArgs_getTestCasesForTestSuite(self): def test_listKeywordsForTC_FullExternalId(self): self.api.loadScenario(SCENARIO_KEYWORDS) response = self.api.listKeywordsForTC('NPROAPI-2') - self.assertEqual({'KeyWord01', 'KeyWord03'}, set(response)) + self.assertEqual(set(['KeyWord01', 'KeyWord03']), set(response)) def test_listKeywordsForTC_InternalId_Int(self): self.api.loadScenario(SCENARIO_KEYWORDS) response = self.api.listKeywordsForTC(8144) - self.assertEqual({'KeyWord01', 'KeyWord03'}, set(response)) + self.assertEqual(set(['KeyWord01', 'KeyWord03']), set(response)) def test_listKeywordsForTC_InternalId_String(self): self.api.loadScenario(SCENARIO_KEYWORDS) response = self.api.listKeywordsForTC('8144') - self.assertEqual({'KeyWord01', 'KeyWord03'}, set(response)) + self.assertEqual(set(['KeyWord01', 'KeyWord03']), set(response)) def test_listKeywordsForTC_One(self): self.api.loadScenario(SCENARIO_KEYWORDS) @@ -562,7 +561,7 @@ def test_listKeywordsForTS_Id_Int(self): set_response = response for item in set_response: set_response[item] = set(response[item]) - self.assertEqual({'8144': {'KeyWord01', 'KeyWord03'}}, set_response) + self.assertEqual({'8144': set(['KeyWord01', 'KeyWord03'])}, set_response) def test_listKeywordsForTS_Id_String(self): self.api.loadScenario(SCENARIO_KEYWORDS) @@ -570,7 +569,7 @@ def test_listKeywordsForTS_Id_String(self): set_response = response for item in set_response: set_response[item] = set(response[item]) - self.assertEqual({'8144': {'KeyWord01', 'KeyWord03'}}, set_response) + self.assertEqual({'8144': set(['KeyWord01', 'KeyWord03'])}, set_response) def test_listKeywordsForTS_Multi(self): self.api.loadScenario(SCENARIO_KEYWORDS) @@ -578,8 +577,8 @@ def test_listKeywordsForTS_Multi(self): set_response = response for item in set_response: set_response[item] = set(response[item]) - self.assertEqual({'8144': {'KeyWord01', 'KeyWord03'}, - '8159': {'KeyWord02'}, '8169': set()}, set_response) + self.assertEqual({'8144': set(['KeyWord01', 'KeyWord03']), + '8159': set(['KeyWord02']), '8169': set()}, set_response) def test_whatArgs_getLastExecutionResult(self): argsDescription = self.api.whatArgs('getLastExecutionResult') diff --git a/test/utest-offline/testlinkapigeneric_offline_test.py b/test/utest-offline/testlinkapigeneric_offline_test.py index 123feed..e25ccf0 100644 --- a/test/utest-offline/testlinkapigeneric_offline_test.py +++ b/test/utest-offline/testlinkapigeneric_offline_test.py @@ -27,8 +27,7 @@ from testlink.testlinkerrors import TLArgError, TLResponseError, TLAPIError if sys.version_info[0] < 3: - if sys.version_info[1] < 7: - import unittest2 as unittest + import unittest2 as unittest unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp diff --git a/test/utest-offline/testlinkargs_test.py b/test/utest-offline/testlinkargs_test.py index b8eeb81..24ac934 100644 --- a/test/utest-offline/testlinkargs_test.py +++ b/test/utest-offline/testlinkargs_test.py @@ -28,8 +28,7 @@ from testlink import testlinkargs if sys.version_info[0] < 3: - if sys.version_info[1] < 7: - import unittest2 as unittest + import unittest2 as unittest unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp diff --git a/test/utest-offline/testlinkdecorators_test.py b/test/utest-offline/testlinkdecorators_test.py index 1a04d79..f3701ec 100644 --- a/test/utest-offline/testlinkdecorators_test.py +++ b/test/utest-offline/testlinkdecorators_test.py @@ -30,8 +30,7 @@ decoMakerApiCallReplaceTLResponseError, decoMakerApiCallWithArgs if sys.version_info[0] < 3: - if sys.version_info[1] < 7: - import unittest2 as unittest + import unittest2 as unittest unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp diff --git a/test/utest-offline/testlinkhelper_test.py b/test/utest-offline/testlinkhelper_test.py index f2456b4..71c1917 100644 --- a/test/utest-offline/testlinkhelper_test.py +++ b/test/utest-offline/testlinkhelper_test.py @@ -27,8 +27,7 @@ from testlink import TestLinkHelper if sys.version_info[0] < 3: - if sys.version_info[1] < 7: - import unittest2 as unittest + import unittest2 as unittest unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp diff --git a/test/utest-online/testlinkapi_generic_online_test.py b/test/utest-online/testlinkapi_generic_online_test.py index 9d3b23d..9c3c357 100644 --- a/test/utest-online/testlinkapi_generic_online_test.py +++ b/test/utest-online/testlinkapi_generic_online_test.py @@ -36,8 +36,7 @@ binary_read_mode = 'rb' if sys.version_info[0] < 3: binary_read_mode = 'r' - if sys.version_info[1] < 7: - import unittest2 as unittest + import unittest2 as unittest unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp diff --git a/test/utest-online/testlinkapi_online_test.py b/test/utest-online/testlinkapi_online_test.py index 7429b7c..6598998 100644 --- a/test/utest-online/testlinkapi_online_test.py +++ b/test/utest-online/testlinkapi_online_test.py @@ -37,8 +37,7 @@ binary_read_mode = 'rb' if sys.version_info[0] < 3: binary_read_mode = 'r' - if sys.version_info[1] < 7: - import unittest2 as unittest + import unittest2 as unittest unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp From dfa463b550ff50881c9970bfd3eb7e8fd9049a36 Mon Sep 17 00:00:00 2001 From: mk Date: Wed, 26 Nov 2014 18:36:51 +0530 Subject: [PATCH 3/4] Remove duplicate test(line 58) test_checkDevKey_unknownKey --- test/utest-online/testlinkapi_generic_online_test.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/utest-online/testlinkapi_generic_online_test.py b/test/utest-online/testlinkapi_generic_online_test.py index 9c3c357..606a608 100644 --- a/test/utest-online/testlinkapi_generic_online_test.py +++ b/test/utest-online/testlinkapi_generic_online_test.py @@ -268,10 +268,6 @@ def test_uploadAttachment_unknownID(self): self.client.uploadAttachment(attachemantFile, 4712, 'nodes_hierarchy', title='title 4713', description='descr. 4714') - def test_checkDevKey_unknownKey(self): - with self.assertRaisesRegex(TLResponseError, '2000.*invalid'): - self.client.checkDevKey(devKey='unknownKey') - def test_testLinkVersion(self): response = self.client.testLinkVersion() self.assertRegex(response, '\d*\.\d*\.\d*') From 719bd9369c7518928e625bad0086c6dd3d021ce2 Mon Sep 17 00:00:00 2001 From: mk Date: Wed, 26 Nov 2014 18:50:59 +0530 Subject: [PATCH 4/4] tox - include online tests(local runs only) --- tox.ini | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 8a674f1..fcafe99 100644 --- a/tox.ini +++ b/tox.ini @@ -8,5 +8,4 @@ deps=pytest argparse commands= py.test test/utest-offline -; py.test test/utest-online -; py.test test/test.py + py.test test/utest-online