Skip to content

Commit

Permalink
Add test for tcms_api.TestRun. Closes #194
Browse files Browse the repository at this point in the history
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
atodorov committed Feb 13, 2018
1 parent e9cdd5b commit 70db635
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tcms_api/tests/test_testrun.py
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)

0 comments on commit 70db635

Please sign in to comment.