Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[qatl] api_tprojects , fails when 1 alone tproject #51

Open
netzulo opened this issue Jul 5, 2018 · 0 comments
Open

[qatl] api_tprojects , fails when 1 alone tproject #51

netzulo opened this issue Jul 5, 2018 · 0 comments
Assignees
Labels

Comments

@netzulo
Copy link
Owner

netzulo commented Jul 5, 2018

Description

  • FAILED 1 tproject exist at testlink webapp
  • PASSED 2 or more tprojects exist at testlink webapp
================================== FAILURES ===================================
____________________ TestMethods.test_001_method_tprojects ____________________

self = <tests.unitaries.suite_002_methods.TestMethods testMethod=test_001_method_tprojects>

    @skipIf(SKIP, SKIP_MESSAGE)
    def test_001_method_tprojects(self):
        """TODO: doc method"""
        tprojects = self.testlink_manager.api_tprojects(
>           dev_key=API_DEV_KEY)

tests\unitaries\suite_002_methods.py:46:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <qatestlink.core.testlink_manager.TLManager object at 0x000002649A2B8D30>
dev_key = '1bfd2ef4ceda22b482b12f2b25457495'

    def api_tprojects(self, dev_key=None):
        """Call to method named 'tl.getProjects' for testlink XMLRPC

            Keyword Arguments:
                dev_key {str} -- string of developer key provided by Testlink
                    (default: {value obtained from JSON settings file})

            Returns:
                list(TProject) -- list of object model for Testlink Test Project
                    data
            """
        if not dev_key:
            dev_key = self._settings.get('dev_key')
        req_data = self._xml_manager.req_tprojects(dev_key)
        res = self._conn.post(self._xml_manager.headers, req_data)
        res_dict = self._xml_manager.parse_response(res)
        res_param = res_dict.get(
            'methodResponse')['params']['param']['value']
        data_list = res_param.get('array')['data']['value']
        tprojects = list()
        for data_properties in data_list:
            properties = data_properties['struct']['member']
            tproject = TProject(properties)
>           tprojects.append(tproject)
E           TypeError: string indices must be integers

Notes

when 1 tproject, xml returned it's different, must to filter 1 struct and array of struct

@netzulo netzulo self-assigned this Jul 5, 2018
@netzulo netzulo added the Bug label Jul 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant