|
31 | 31 | import sys
|
32 | 32 | import os.path
|
33 | 33 |
|
34 |
| -if sys.version_info[0] == 3: |
35 |
| - BINARY_READ_MODE = 'rb' |
36 |
| -else: |
37 |
| - BINARY_READ_MODE = 'r' |
38 |
| - |
39 | 34 | if sys.version_info[0] == 2 and sys.version_info[1] == 6:
|
40 | 35 | # py26 needs backport unittest2
|
41 | 36 | import unittest2 as unittest
|
@@ -206,7 +201,7 @@ def test_reportTCResult_unknownID(self):
|
206 | 201 | buildname='build 4713', notes='note 4714' )
|
207 | 202 |
|
208 | 203 | def test_uploadExecutionAttachment_unknownID(self):
|
209 |
| - attachemantFile = open(os.path.realpath(__file__), BINARY_READ_MODE) |
| 204 | + attachemantFile = open(os.path.realpath(__file__), 'r') |
210 | 205 | with self.assertRaisesRegex(TLResponseError, '6004.*4712'):
|
211 | 206 | self.client.uploadExecutionAttachment(attachemantFile, 4712,
|
212 | 207 | title='title 4713', description='descr. 4714')
|
@@ -246,37 +241,37 @@ def test_deleteTestCaseSteps_unknownID(self):
|
246 | 241 | self.client.deleteTestCaseSteps('N-4711', steps, version=1)
|
247 | 242 |
|
248 | 243 | def test_uploadRequirementSpecificationAttachment_unknownID(self):
|
249 |
| - attachemantFile = open(os.path.realpath(__file__), BINARY_READ_MODE) |
| 244 | + attachemantFile = open(os.path.realpath(__file__), 'r') |
250 | 245 | with self.assertRaisesRegex(TLResponseError, '6004.*4712'):
|
251 | 246 | self.client.uploadRequirementSpecificationAttachment(attachemantFile, 4712,
|
252 | 247 | title='title 4713', description='descr. 4714')
|
253 | 248 |
|
254 | 249 | def test_uploadRequirementAttachment_unknownID(self):
|
255 |
| - attachemantFile = open(os.path.realpath(__file__), BINARY_READ_MODE) |
| 250 | + attachemantFile = open(os.path.realpath(__file__), 'r') |
256 | 251 | with self.assertRaisesRegex(TLResponseError, '6004.*4712'):
|
257 | 252 | self.client.uploadRequirementAttachment(attachemantFile, 4712,
|
258 | 253 | title='title 4713', description='descr. 4714')
|
259 | 254 |
|
260 | 255 | def test_uploadTestProjectAttachment_unknownID(self):
|
261 |
| - attachemantFile = open(os.path.realpath(__file__), BINARY_READ_MODE) |
| 256 | + attachemantFile = open(os.path.realpath(__file__), 'r') |
262 | 257 | with self.assertRaisesRegex(TLResponseError, '7000.*4712'):
|
263 | 258 | self.client.uploadTestProjectAttachment(attachemantFile, 4712,
|
264 | 259 | title='title 4713', description='descr. 4714')
|
265 | 260 |
|
266 | 261 | def test_uploadTestSuiteAttachment_unknownID(self):
|
267 |
| - attachemantFile = open(os.path.realpath(__file__), BINARY_READ_MODE) |
| 262 | + attachemantFile = open(os.path.realpath(__file__), 'r') |
268 | 263 | with self.assertRaisesRegex(TLResponseError, '8000.*4712'):
|
269 | 264 | self.client.uploadTestSuiteAttachment(attachemantFile, 4712,
|
270 | 265 | title='title 4713', description='descr. 4714')
|
271 | 266 |
|
272 | 267 | def test_uploadTestCaseAttachment_unknownID(self):
|
273 |
| - attachemantFile = open(os.path.realpath(__file__), BINARY_READ_MODE) |
| 268 | + attachemantFile = open(os.path.realpath(__file__), 'r') |
274 | 269 | with self.assertRaisesRegex(TLResponseError, '5000.*testcaseid'):
|
275 | 270 | self.client.uploadTestCaseAttachment(attachemantFile, 4712,
|
276 | 271 | title='title 4713', description='descr. 4714')
|
277 | 272 |
|
278 | 273 | def test_uploadAttachment_unknownID(self):
|
279 |
| - attachemantFile = open(os.path.realpath(__file__), BINARY_READ_MODE) |
| 274 | + attachemantFile = open(os.path.realpath(__file__), 'r') |
280 | 275 | with self.assertRaisesRegex(TLResponseError, '6004.*4712'):
|
281 | 276 | self.client.uploadAttachment(attachemantFile, 4712, 'nodes_hierarchy',
|
282 | 277 | title='title 4713', description='descr. 4714')
|
|
0 commit comments