From: Jose Perez Carranza <jose.perez.carra...@linux.intel.com> Correct function “testrun_list” to retrieve a list of of TestRun dictionaries instead of TestCase dictionaries.
Signed-off-by: Jose Perez Carranza <jose.perez.carra...@linux.intel.com> --- external/testopia.py | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/external/testopia.py b/external/testopia.py index d42538b..f2f2d45 100755 --- a/external/testopia.py +++ b/external/testopia.py @@ -161,7 +161,7 @@ class TestopiaXmlrpcError(Exception): def __str__(self): return "Error while executing cmd '%s' --> %s" \ % ( self.verb + "(" + self.params + ")", self.wrappedError) - + class Testopia(object): view_all=True # By default, a list returns at most 25 elements. We force here to see all. @@ -176,7 +176,7 @@ class Testopia(object): For example, given config.txt containing: [testopia] - login: j...@mycompany.com', + login: j...@mycompany.com', password: jdoepassword' url: https://myhost.mycompany.com/bugzilla/tr_xmlrpc.cgi @@ -191,15 +191,15 @@ class Testopia(object): kwargs = dict([(key, cp.get('testopia', key)) \ for key in ['username', 'password', 'url']]) return Testopia(**kwargs) - + def __init__(self, username, password, url, sslverify=True): """Initialize the Testopia driver. 'username' -- string, the account to log into Testopia such as j...@mycompany.com, 'password' -- string, the password for the username, - 'url' -- string, the URL of the XML-RPC interface + 'url' -- string, the URL of the XML-RPC interface - Example: t = Testopia('j...@mycompany.com', + Example: t = Testopia('j...@mycompany.com', 'jdoepassword' 'https://myhost.mycompany.com/bugzilla/tr_xmlrpc.cgi') """ @@ -411,7 +411,7 @@ class Testopia(object): return eval(cmd) except xmlrpclib.Error, e: raise TestopiaXmlrpcError(verb, params, e) - + ############################## Build ####################################### @@ -545,7 +545,7 @@ class Testopia(object): )]) def environment_check_by_name(self, name, product_id): - return self.do_command("Environment.check_environment", + return self.do_command("Environment.check_environment", [self._string_noop(name), self._number_noop(product_id)]) @@ -1437,9 +1437,9 @@ class Testopia(object): Example: testrun_list(run_id=20, run_id_type='lessthan') - Result: A list of TestCase dictionaries + Result: A list of TestRun dictionaries """ - return self.do_command("TestCase.list", [self._options_ne_dict( + return self.do_command("TestRun.list", [self._options_ne_dict( self._number_option('run_id', run_id), self._search_op('runid_type', run_id_type), self._number_option('build_id', build_id), @@ -1497,7 +1497,7 @@ class Testopia(object): )]) - def testrun_update(self, run_id, status_id,build_id=None, + def testrun_update(self, run_id, status_id,build_id=None, environment_id=None, manager_id=None, plan_text_version=None, summary=None, notes=None, product_version=None, stop_date=None): @@ -1862,7 +1862,7 @@ class TestopiaUnitTest(unittest.TestCase): class LoginUnitTests(TestopiaUnitTest): def test_login(self): # Ensure that we logged in, and that we have our userId recorded: - self.assert_(self.testopia is not None) + self.assert_(self.testopia is not None) self.assert_(self.testopia.userId>0) def test_bogus_call(self): @@ -1877,7 +1877,7 @@ class BuildUnitTests(TestopiaUnitTest): self.assertEquals(buildDict['build_id'], buildId) self.assert_('product_id' in buildDict) # etc - + """API entry points that aren't yet covered: def build_create(self, name, product_id, description=None, milestone=None, isactive=None) @@ -1892,7 +1892,7 @@ class BuildUnitTests(TestopiaUnitTest): """ def build_lookup_name_by_id(self, id) """ - + class EnvironmentUnitTests(TestopiaUnitTest): def test_environment_get(self): envId = 1 @@ -1905,7 +1905,7 @@ class EnvironmentUnitTests(TestopiaUnitTest): def test_environment_list(self): envList = self.testopia.environment_list() self.assertEquals(type(envList), type([])) - envDict = envList[0] + envDict = envList[0] self.assert_('environment_id' in envDict) self.assert_('product_id' in envDict) self.assert_('isactive' in envDict) @@ -1951,7 +1951,7 @@ class ProductUnitTests(TestopiaUnitTest): def test_product_lookup_id_by_name(self): productId = self.testopia.product_lookup_id_by_name(self.testProductName) self.assert_is_int(productId) - + def test_product_check_by_name(self): productDict = self.testopia.product_check_by_name(self.testProductName) self.assertEquals(productDict['name'], self.testProductName) @@ -2089,7 +2089,7 @@ class TestRunUnitTests(TestopiaUnitTest): def testrun_lookup_environment_id_by_name(self, name): def testrun_lookup_environment_name_by_id(self, id): """ - + class TestCaseRunUnitTests(TestopiaUnitTest): """API entry points that aren't yet covered: def testcaserun_get(self, case_run_id): @@ -2124,7 +2124,7 @@ class TestCaseRunUnitTests(TestopiaUnitTest): # Hook into pyunit's command-line handling, which will invoke the test # suite if run directly rather than imported; use -v for more verbose output -# +# # You'll have to have a 'unittest.cfg' file containing config for whatever # Testopia instance you're talking to # -- 2.11.0 -- _______________________________________________ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto