-
-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for tcms_api.TestRun. Closes #194
this problem in #194 was solved during the XML-RPC refactoring. This commit adds the necessary test to demonstrate everything is working without raising exceptions.
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
# | ||
# Copyright (c) 2018 the Kiwi TCMS project. All rights reserved. | ||
# Author: Alexander Todorov <[email protected]> | ||
# | ||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
from tcms_api.mutable import TestRun | ||
|
||
from tcms_api.tests import BaseAPIClient_TestCase | ||
|
||
from tcms.tests.factories import TestRunFactory | ||
from tcms.tests.factories import TestCaseRunFactory | ||
|
||
|
||
class TestTestRunTests(BaseAPIClient_TestCase): | ||
def _fixture_setup(self): | ||
super(TestTestRunTests, self)._fixture_setup() | ||
|
||
self.testrun = TestRunFactory() | ||
for i in range(5): | ||
TestCaseRunFactory(run=self.testrun) | ||
|
||
def test_iterating_over_testrun_doesnt_crash(self): | ||
""" | ||
https://github.com/kiwitcms/Kiwi/issues/194 | ||
""" | ||
i = 0 | ||
for caserun in TestRun(self.testrun.pk): | ||
self.assertEqual('IDLE', caserun.status._name) | ||
i += 1 | ||
self.assertEqual(5, i) |