96
96
'id' : '26' , 'tsuite_name' : 'AA - Second Level' ,
97
97
'name' : 'TESTCASE_AA' }]},
98
98
'getTestCase' : {
99
- '26' : [{'full_tc_external_id' : 'NPROAPI-1-26 ' , 'node_order' : '0' , 'is_open' : '1' , 'id' : '26 ' ,
99
+ '26-1 ' : [{'full_tc_external_id' : 'NPROAPI-1' , 'node_order' : '0' , 'is_open' : '1' , 'id' : '27 ' ,
100
100
'author_last_name' : 'LkaTlinkD7' , 'updater_login' : '' , 'layout' : '1' , 'tc_external_id' : '1' ,
101
101
'version' : '1' , 'estimated_exec_duration' : '' , 'testsuite_id' : '25' , 'updater_id' : '' ,
102
- 'status' : '1' , 'updater_first_name' : '' , 'testcase_id' : '5099 ' , 'author_first_name' : 'Tester' ,
103
- 'importance' : '2' , 'modification_ts' : '' , 'execution_type' : '1' , 'preconditions' : '' ,
102
+ 'status' : '1' , 'updater_first_name' : '' , 'testcase_id' : '26 ' , 'author_first_name' : 'Tester' ,
103
+ 'importance' : '2' , 'modification_ts' : '' , 'execution_type' : '1' , 'preconditions' : 'V1 ' ,
104
104
'active' : '1' , 'creation_ts' : '2013-12-26 21:17:43' , 'name' : 'TC-C' , 'summary' : 'SumSumSum' ,
105
105
'updater_last_name' : '' ,
106
+ 'steps' : [{'step_number' : '1' , 'actions' : 'Step action 1' , 'execution_type' : '2' , 'active' : '1' ,
107
+ 'id' : '5101' , 'expected_results' : 'Step result 1' }],
108
+ 'author_id' : '3' , 'author_login' : 'tester' }],
109
+ '26-2' : [{'full_tc_external_id' : 'NPROAPI-1' , 'node_order' : '0' , 'is_open' : '1' , 'id' : '127' ,
110
+ 'author_last_name' : 'LkaTlinkD7' , 'updater_login' : '' , 'layout' : '1' , 'tc_external_id' : '1' ,
111
+ 'version' : '2' , 'estimated_exec_duration' : '' , 'testsuite_id' : '25' , 'updater_id' : '' ,
112
+ 'status' : '1' , 'updater_first_name' : '' , 'testcase_id' : '26' , 'author_first_name' : 'Tester' ,
113
+ 'importance' : '2' , 'modification_ts' : '' , 'execution_type' : '1' , 'preconditions' : 'V2' ,
114
+ 'active' : '1' , 'creation_ts' : '2013-12-26 22:17:43' , 'name' : 'TC-C' , 'summary' : 'SumSumSum' ,
115
+ 'updater_last_name' : '' ,
116
+ 'steps' : [{'step_number' : '1' , 'actions' : 'Step action 1' , 'execution_type' : '2' , 'active' : '1' ,
117
+ 'id' : '5101' , 'expected_results' : 'Step result 1' }],
118
+ 'author_id' : '3' , 'author_login' : 'tester' }],
119
+ '26-None' : [{'full_tc_external_id' : 'NPROAPI-1' , 'node_order' : '0' , 'is_open' : '1' , 'id' : '127' ,
120
+ 'author_last_name' : 'LkaTlinkD7' , 'updater_login' : '' , 'layout' : '1' , 'tc_external_id' : '1' ,
121
+ 'version' : '2' , 'estimated_exec_duration' : '' , 'testsuite_id' : '25' , 'updater_id' : '' ,
122
+ 'status' : '1' , 'updater_first_name' : '' , 'testcase_id' : '26' , 'author_first_name' : 'Tester' ,
123
+ 'importance' : '2' , 'modification_ts' : '' , 'execution_type' : '1' , 'preconditions' : 'V2 None' ,
124
+ 'active' : '1' , 'creation_ts' : '2013-12-26 22:17:43' , 'name' : 'TC-C' , 'summary' : 'SumSumSum' ,
125
+ 'updater_last_name' : '' ,
106
126
'steps' : [{'step_number' : '1' , 'actions' : 'Step action 1' , 'execution_type' : '2' , 'active' : '1' ,
107
127
'id' : '5101' , 'expected_results' : 'Step result 1' }],
108
128
'author_id' : '3' , 'author_login' : 'tester' }]
129
+
109
130
},
110
131
'getFullPath' : {
111
132
@@ -159,7 +180,7 @@ def _callServer(self, methodAPI, argsAPI=None):
159
180
elif methodAPI in ['getTestCaseIDByName' ]:
160
181
response = data [argsAPI ['testcasename' ]]
161
182
elif methodAPI in ['getTestCase' ]:
162
- response = data [argsAPI [ ' testcaseid' ] ]
183
+ response = data ['%( testcaseid)s-%(version)s' % argsAPI ]
163
184
elif methodAPI in ['getFullPath' ]:
164
185
response = data [argsAPI ['nodeid' ]]
165
186
elif methodAPI in ['getTestProjectByName' ]:
@@ -300,6 +321,7 @@ def test__copyTC_create_new_version(self):
300
321
self .api ._copyTC ('26' , {}, duplicateaction = 'create_new_version' )
301
322
self .assertEqual ('create_new_version' ,
302
323
self .api .callArgs ['actiononduplicatedname' ])
324
+ self .assertEqual ('V2 None' , self .api .callArgs ['preconditions' ])
303
325
304
326
def test__copyTC_changedArgs (self ):
305
327
self .api .loadScenario (SCENARIO_A )
@@ -308,24 +330,56 @@ def test__copyTC_changedArgs(self):
308
330
self .assertEqual ('4711' , self .api .callArgs ['testsuiteid' ])
309
331
self .assertEqual ('2211' , self .api .callArgs ['testprojectid' ])
310
332
333
+ def test__copyTC_changedArgs_version (self ):
334
+ self .api .loadScenario (SCENARIO_A )
335
+ self .api ._copyTC ('26' , {'testsuiteid' :'4711' }, 1 ,
336
+ duplicateaction = 'generate_new' )
337
+ self .assertEqual ('4711' , self .api .callArgs ['testsuiteid' ])
338
+ self .assertEqual ('2211' , self .api .callArgs ['testprojectid' ])
339
+ self .assertEqual ('V1' , self .api .callArgs ['preconditions' ])
340
+
341
+
311
342
def test_copyTCnewVersion (self ):
312
343
self .api .loadScenario (SCENARIO_A )
313
344
self .api .copyTCnewVersion ('26' , summary = 'The summary has changed' ,
314
345
importance = '33' )
315
346
self .assertEqual ('create_new_version' ,
316
347
self .api .callArgs ['actiononduplicatedname' ])
348
+ self .assertEqual ('V2 None' , self .api .callArgs ['preconditions' ])
317
349
self .assertEqual ('The summary has changed' , self .api .callArgs ['summary' ])
318
350
self .assertEqual ('33' , self .api .callArgs ['importance' ])
319
351
self .assertEqual ('TC-C' , self .api .callArgs ['testcasename' ])
320
352
self .assertEqual ('25' , self .api .callArgs ['testsuiteid' ])
321
353
self .assertEqual ('21' , self .api .callArgs ['testprojectid' ])
322
354
355
+ def test_copyTCnewVersion_version (self ):
356
+ self .api .loadScenario (SCENARIO_A )
357
+ self .api .copyTCnewVersion ('26' , 1 , summary = 'The summary has changed' ,
358
+ importance = '33' )
359
+ self .assertEqual ('create_new_version' ,
360
+ self .api .callArgs ['actiononduplicatedname' ])
361
+ self .assertEqual ('V1' , self .api .callArgs ['preconditions' ])
362
+ self .assertEqual ('The summary has changed' , self .api .callArgs ['summary' ])
363
+ self .assertEqual ('33' , self .api .callArgs ['importance' ])
364
+ self .assertEqual ('TC-C' , self .api .callArgs ['testcasename' ])
365
+ self .assertEqual ('25' , self .api .callArgs ['testsuiteid' ])
366
+ self .assertEqual ('21' , self .api .callArgs ['testprojectid' ])
323
367
324
368
def test_copyTCnewTestCase (self ):
325
369
self .api .loadScenario (SCENARIO_A )
326
370
self .api .copyTCnewTestCase ('26' , testsuiteid = '4711' )
327
371
self .assertEqual ('generate_new' ,
328
372
self .api .callArgs ['actiononduplicatedname' ])
373
+ self .assertEqual ('V2 None' , self .api .callArgs ['preconditions' ])
374
+ self .assertEqual ('4711' , self .api .callArgs ['testsuiteid' ])
375
+ self .assertEqual ('2211' , self .api .callArgs ['testprojectid' ])
376
+
377
+ def test_copyTCnewTestCase_version (self ):
378
+ self .api .loadScenario (SCENARIO_A )
379
+ self .api .copyTCnewTestCase ('26' , 1 , testsuiteid = '4711' )
380
+ self .assertEqual ('generate_new' ,
381
+ self .api .callArgs ['actiononduplicatedname' ])
382
+ self .assertEqual ('V1' , self .api .callArgs ['preconditions' ])
329
383
self .assertEqual ('4711' , self .api .callArgs ['testsuiteid' ])
330
384
self .assertEqual ('2211' , self .api .callArgs ['testprojectid' ])
331
385
0 commit comments