Skip to content

py3 support patch 1 #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Nov 26, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -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

Expand Down
5 changes: 3 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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?

Expand All @@ -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
.. _charz: https://github.com/charz/TestLink-API-Python-client.git
.. _manojklm: https://github.com/manojklm/TestLink-API-Python-client
2 changes: 1 addition & 1 deletion src/testlink/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
#
# ------------------------------------------------------------------------

VERSION = '0.6'
VERSION = '0.6.0-dev'
TL_RELEASE = '1.9.12'

1 change: 1 addition & 0 deletions test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 8 additions & 9 deletions test/utest-offline/testlinkapi_offline_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -562,24 +561,24 @@ 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)
response = self.api.listKeywordsForTS('4711')
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)
response = self.api.listKeywordsForTS('deepFalse3')
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')
Expand Down
3 changes: 1 addition & 2 deletions test/utest-offline/testlinkapigeneric_offline_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
3 changes: 1 addition & 2 deletions test/utest-offline/testlinkargs_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
3 changes: 1 addition & 2 deletions test/utest-offline/testlinkdecorators_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
3 changes: 1 addition & 2 deletions test/utest-offline/testlinkhelper_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
7 changes: 1 addition & 6 deletions test/utest-online/testlinkapi_generic_online_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -269,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*')
Expand Down
3 changes: 1 addition & 2 deletions test/utest-online/testlinkapi_online_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
3 changes: 1 addition & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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