Code Monkey home page Code Monkey logo

qatestlink's People

Contributors

netzulo avatar terseus avatar

Watchers

 avatar  avatar

Forkers

orenault

qatestlink's Issues

[qatl] api_tprojects, not raise ResponseException when dev_key it's invalid

Description

  • Must return code 200, or another thing? testlink XMLRPC problem
  • Should recognize error structure and raise ResponseException to get working this testcase
    @pytest.skip(True, 'Issue oneped at qatestlink library, #52')
    @pytest.mark.raises(exception=ResponseException)
    def test_raises_tprojects_baddevkey(self):
        """TestCase: test_raises_tprojects_baddevkey"""
        tprojects = self.tlm.api_tprojects(dev_key='willfail')
        if len(tprojects) >= 0:
            raise AssertionError("Not empty Test Projects")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <qatestlink.core.testlink_manager.TLManager object at 0x00000263FF1451D0>
dev_key = 'willfail'

    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']
E           TypeError: string indices must be integers

c:\users\cronosadmin\envs\tltests\lib\site-packages\qatestlink-0.0.9-py3.6.egg\qatestlink\core\testlink_manager.py:107: TypeError
-------------------------- Captured stderr teardown ---------------------------
2018-07-05 23:16:51,833 - qatestlink - INFO - POST request:
2018-07-05 23:16:51,833 - qatestlink - DEBUG -     url=http://qalab.tk:86/lib/api/xmlrpc/v1/xmlrpc.php
2018-07-05 23:16:51,833 - qatestlink - DEBUG -     headers={'Content-Type': 'application/xml'}
2018-07-05 23:16:51,833 - qatestlink - DEBUG -     data=b'<?xml version="1.0" encoding="UTF-8" ?><methodCall><methodName>tl.getProjects</methodName><params><struct><name>devKey</name><value>willfail</value></struct></params></methodCall>'
2018-07-05 23:16:51,892 - qatestlink - INFO - POST response:
2018-07-05 23:16:51,892 - qatestlink - INFO -     status_code=200
2018-07-05 23:16:51,892 - qatestlink - DEBUG -     data=<?xml version="1.0"?>
<methodResponse>
  <params>
    <param>
      <value>
        <array><data>
  <value><struct>
  <member><name>code</name><value><int>2000</int></value></member>
  <member><name>message</name><value><string>Can not authenticate client: invalid developer key</string></value></member>
</struct></value>
</data></array>
      </value>
    </param>
  </params>
</methodResponse>

api_tcase_report, clarify valid values for new TestCase status

Documentation

Clarify wich values are valid for call api_tcase_report

$tcaseStatusCode['passed']='p'; // passed
$tcaseStatusCode['blocked']='b'; // blocked
$tcaseStatusCode['failed']='f'; // failed
$tcaseStatusCode['wrong']='w'; // The status code (w) provided is not valid!
$tcaseStatusCode['departed']='d'; // The status code (d) provided is not valid!

TCs

>>> tlm.api_tcase_report(external_id="qatl-2", tplan_id=5, build_id=5, platform_id=2, status="f")
2018-07-30 15:12:01,543 - qatestlink - INFO - POST request:
2018-07-30 15:12:01,686 - qatestlink - INFO - POST response:
2018-07-30 15:12:01,687 - qatestlink - INFO -     status_code=200
RTCase: id=118, status:bool=True, operation=reportTCResult,overwrite=True, message=Success!
>>> tlm.api_tcase_report(external_id="qatl-2", tplan_id=5, build_id=5, platform_id=2, status="b")
2018-07-30 15:12:28,012 - qatestlink - INFO - POST request:
2018-07-30 15:12:28,141 - qatestlink - INFO - POST response:
2018-07-30 15:12:28,141 - qatestlink - INFO -     status_code=200
RTCase: id=119, status:bool=True, operation=reportTCResult,overwrite=True, message=Success!
>>> tlm.api_tcase_report(external_id="qatl-2", tplan_id=5, build_id=5, platform_id=2, status="p")
2018-07-30 15:12:49,845 - qatestlink - INFO - POST request:
2018-07-30 15:12:49,953 - qatestlink - INFO - POST response:
2018-07-30 15:12:49,953 - qatestlink - INFO -     status_code=200
RTCase: id=120, status:bool=True, operation=reportTCResult,overwrite=True, message=Success!
>>> tlm.api_tcase_report(external_id="qatl-2", tplan_id=5, build_id=5, platform_id=2, status="w")
2018-07-30 15:19:07,862 - qatestlink - INFO - POST request:
2018-07-30 15:19:07,991 - qatestlink - INFO - POST response:
2018-07-30 15:19:07,991 - qatestlink - INFO -     status_code=200
RTCase: id=None, status:bool=None, operation=None,overwrite=None, message=The status code (w) provided is not valid!
>>> tlm.api_tcase_report(external_id="qatl-2", tplan_id=5, build_id=5, platform_id=2, status="d")
2018-07-30 15:19:14,702 - qatestlink - INFO - POST request:
2018-07-30 15:19:14,787 - qatestlink - INFO - POST response:
2018-07-30 15:19:14,788 - qatestlink - INFO -     status_code=200
RTCase: id=None, status:bool=None, operation=None,overwrite=None, message=The status code (d) provided is not valid!
>>> 

Doc error at api_tproject_tplans, return a list, not an object

At function documentation api_tproject_tplans , return say returns one object but it's returning a list of models

>>> tplans = tlm.api_tproject_tplans(1)
2018-03-16 10:45:08,249 - qatestlink - INFO - POST request:
2018-03-16 10:45:08,344 - qatestlink - INFO - POST response:
2018-03-16 10:45:08,344 - qatestlink - INFO -     status_code=200
>>> tplans
[TPlan: id=2, name=v0.4.1, is_public=True, TPlan: id=7, name=v0.4.1rc-a, is_public=True]

[qatl] api_tproject_tsuites_first_level with not created first level TSuite, KeyError not handle by ResponseException

Description

When a projectid doesn't have any TestSuite at first level, not handle with ResponseExcepcion because return empty structure data

> d:\4.developmentworkspaces\1.github\qalab\modules\qatestlink\tests\unitaries\suite_002_methods.py(74)test_004_method_tproject_tsuites_first_level()
-> tsuites = self.testlink_manager.api_tproject_tsuites_first_level(
(Pdb) l
 69
 70         @skipIf(SKIP, SKIP_MESSAGE)
 71         def test_004_method_tproject_tsuites_first_level(self):
 72             """TODO: doc method"""
 73             import pdb; pdb.set_trace() # TODO, remove DEBUG lane
 74  ->         tsuites = self.testlink_manager.api_tproject_tsuites_first_level(
 75                 DATA['tproject_id'])
 76             self.assertIsInstance(tsuites, list)
 77             self.assertGreater(len(tsuites), 0)
 78             for tsuite in tsuites:
 79                 self.testlink_manager.log.debug(repr(tsuite))
(Pdb) tsuites
*** NameError: name 'tsuites' is not defined
(Pdb) DATA['tproject_id']
2
(Pdb) self.testlink_manager.api_tproject_tsuites_first_level(2)
*** KeyError: 'int'
(Pdb) tsuites = self.testlink_manager.api_tproject_tsuites_first_level(DATA['tproject_id'])
*** KeyError: 'int'

Response.xml

<?xml version="1.0"?>
<methodResponse>
    <params>
        <param>
            <value>
                <array>
                    <data></data>
                </array>
            </value>
        </param>
    </params>
</methodResponse>

api_tplan_builds, remove notes property from repr

At get platforms from api_tplan_platforms, remove notes property from repr function because it's showing HTML text at python sys output

>>> builds = tlm.api_tplan_builds(1)
2018-03-16 11:21:58,762 - qatestlink - INFO - POST request:
2018-03-16 11:21:58,890 - qatestlink - INFO - POST response:
2018-03-16 11:21:58,890 - qatestlink - INFO -     status_code=200
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "qatestlink/core/testlink_manager.py", line 279, in api_tplan_builds
    properties = data_properties['struct']['member']
TypeError: string indices must be integers
>>> builds = tlm.api_tplan_builds(2)
2018-03-16 11:22:00,674 - qatestlink - INFO - POST request:
2018-03-16 11:22:00,798 - qatestlink - INFO - POST response:
2018-03-16 11:22:00,798 - qatestlink - INFO -     status_code=200
>>> builds
[TBuild: id=1, name=issue1, notes=<p>Github issue1</p>, testplan_id=2, TBuild: id=2, name=issue2, notes=<p>Github issue2</p>, testplan_id=2]

api_tplan_platforms, remove notes property from repr

At get platforms from api_tplan_platforms, remove notes property from repr function because it's showing HTML text at python sys output

>>> platforms = tlm.api_tplan_platforms(1)                                                                                                                                                                                                                                      
2018-03-16 11:16:10,611 - qatestlink - INFO - POST request:
2018-03-16 11:16:10,703 - qatestlink - INFO - POST response:
2018-03-16 11:16:10,703 - qatestlink - INFO -     status_code=200
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "qatestlink/core/testlink_manager.py", line 250, in api_tplan_platforms
    properties = data_properties['struct']['member']
TypeError: string indices must be integers
>>> platforms = tlm.api_tplan_platforms(2)                                                                                                                                                                                                                                      
2018-03-16 11:16:49,707 - qatestlink - INFO - POST request:
2018-03-16 11:16:49,817 - qatestlink - INFO - POST response:
2018-03-16 11:16:49,817 - qatestlink - INFO -     status_code=200
>>> platforms
[TPlatform: id=1, name=DEV, notes=<p>DEVelopment environment</p>, TPlatform: id=2, name=INT, notes=<table>
        <tbody>
                <tr>
                        <td>INTegration environment</td>
                </tr>
        </tbody>
</table>]
>>> 
>>> platforms[0]
TPlatform: id=1, name=DEV, notes=<p>DEVelopment environment</p>
>>> help(platforms[0])

>>> dir(platforms[0])
['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_load', '_properties', '_properties_bool', '_properties_int', 'convert_name', 'id', 'name', 'notes']
>>> 

api_tsuite, not fail if ID params does not exist for Testlink webapp

api_tsuite don't handle if ID does not exist for testlink, maybe error it's at error response structure

>>> tsuite = tlm.api_tsuite(1)
2018-03-16 12:07:26,206 - qatestlink - INFO - POST request:
2018-03-16 12:07:26,486 - qatestlink - INFO - POST response:
2018-03-16 12:07:26,486 - qatestlink - INFO -     status_code=200
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "qatestlink/core/testlink_manager.py", line 356, in api_tsuite
    properties = res_param.get('struct')['member']
TypeError: 'NoneType' object has no attribute '__getitem__'
>>> tsuite = tlm.api_tsuite(2)
2018-03-16 12:07:29,425 - qatestlink - INFO - POST request:
2018-03-16 12:07:29,548 - qatestlink - INFO - POST response:
2018-03-16 12:07:29,548 - qatestlink - INFO -     status_code=200
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "qatestlink/core/testlink_manager.py", line 356, in api_tsuite
    properties = res_param.get('struct')['member']
TypeError: 'NoneType' object has no attribute '__getitem__'
>>> tsuite = tlm.api_tsuite(3)
2018-03-16 12:07:31,526 - qatestlink - INFO - POST request:
2018-03-16 12:07:31,653 - qatestlink - INFO - POST response:
2018-03-16 12:07:31,653 - qatestlink - INFO -     status_code=200
>>> 

[qatl] api_tplan, tprojectname valid but no tplanname passed not Raise any exception

Description

When use api_tplan method with a valid tprojectname but not valid tplanname return Tplan Object with no data loaded , maybe must raise ResponseException

 34             tplan = self.tlm.api_tplan('testlink-tests', ' ')
tests/api/suite_tplan_by_name.py::TestTProjects::test_get_tplan_by_name
>>>>>>>>>>>>>>>>>>> PDB set_trace (IO-capturing turned off) >>>>>>>>>>>>>>>>>>>
> d:\4.developmentworkspaces\1.github\testlink-tests\tests\api\suite_tplan_by_name.py(36)test_get_tplan_by_name()
-> self.log.debug(repr(tplan))
(Pdb) l
 31             """
 32             msg_error = ("If empty testlink install, create at"
 33                          " least one and assign to testprojectname")
 34             tplan = self.tlm.api_tplan('testlink-tests', ' ')
 35             import pdb; pdb.set_trace() # TODO, remove DEBUG lane
 36  ->         self.log.debug(repr(tplan))
 37             self.assert_is_instance(tplan, TPlan, msg=msg_error)
 38
 39         @pytest.mark.skipIf(True, "Issue oneped at qatestlink library, #52")
 40         @pytest.mark.raises(exception=ResponseException)
 41         def test_raises_tplan_by_name_baddevkey(self):
(Pdb) tplan
TPlan: id=None, name=None, is_public=None
(Pdb) dir(tplan)
['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_load', '_properties', '_properties_bool', '_properties_int', 'active', 'convert_name', 'id', 'is_public', 'message', 'name', 'notes', 'tproject_id']
(Pdb) tplan.tproject_id
(Pdb) tplan.notes
(Pdb)

Improve imports at library

Imports can be improved

when you got imports like this

 from qatestlink.core.models.tl_models import TBuild
 from qatestlink.core.models.tl_models import TCase
 from qatestlink.core.models.tl_models import TPlan
 from qatestlink.core.models.tl_models import TPlatform
 from qatestlink.core.models.tl_models import TProject
 from qatestlink.core.models.tl_models import TSuite

Must be like

from qatestlink.core.models.tl_models import (
    TBUild, TCase, TPlan, Tplanform, TProject, TSuite,
)

[qaltl] api_tplan_totals, obsolete method for tl-v1.9.17

Description

Outdated code for last version of testlink 1.9.17

__________________ TestMethods.test_011_method_tplan_totals ___________________

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

    @skipIf(SKIP, SKIP_MESSAGE)
    def test_011_method_tplan_totals(self):
        """TODO: doc method"""
        totals = self.testlink_manager.api_tplan_totals(
>           DATA['tplan_id'])

tests\unitaries\suite_002_methods.py:149:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
qatestlink\core\testlink_manager.py:375: in api_tplan_totals
    return RTPlanTotals(properties)
qatestlink\core\models\tl_reports.py:48: in __init__
    self._load()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = RTPlanTotals: by_tester:dict={}

    def _load(self):
        super(RTPlanTotals, self)._load()
        for res_property in self._properties:
            name = self.convert_name(res_property['name'])
            value = res_property['value']
            if name == 'with_tester':
                try:
                    with_tester_members = value['struct']['member']
                except KeyError as err:
                    if str(err) == "'struct'":
                        multiple_testers = value.get(
                            'array')['data']['value']['struct']['member']
                        with_tester_members = multiple_testers[0].get(
                            'value')['struct']['member']
                import pdb; pdb.set_trace() # TODO, remove DEBUG lane
>               by_testers = list()
E               KeyError: 'struct'

qatestlink\core\models\tl_reports.py:65: KeyError
------------------------------ Captured log call ------------------------------
connection_base.py          46 INFO     POST request:
connection_base.py          54 INFO     POST response:
connection_base.py          56 INFO         status_code=200

TODO GLOBAL

TODOs

  • create request: TPROJECT_CREATE = 'tl.createTestProject'
  • create request: TPLAN_CREATE = 'tl.createTestPlan'
  • create request: TPLAN_ADD_TCASE = 'tl.addTestCaseToTestPlan'
  • create request: TPLAN_EXEC_LATEST = 'tl.getLastExecutionResult'
  • create request: BUILD_CREATE = 'tl.createBuild'
  • create request: TSUITE_CREATE = 'tl.createTestSuite'
  • create request: TSUITE_TCASES = 'tl.getTestCasesForTestSuite'
  • create request: REQ_ASSIGN = 'tl.assignRequirements'
  • create request: TCASE_CREATE = 'tl.createTestCase'
  • create request: TCASE_ATTACHMENTS = 'tl.getTestCaseAttachments'
  • create request: TCASE_CUSTOM_FIELD_DESIGN_VALUE = 'tl.getTestCaseCustomFieldDesignValue'
  • create request: TLINK_FULL_PATH = 'tl.getFullPath'
  • create request: TLINK_EXEC_DELETE = 'tl.deleteExecution'
  • create request: TPROJECTS = 'tl.getProjects' 796a824
  • create request: TPROJECT_BY_NAME = 'tl.getTestProjectByName' ec947d7
  • create request: TPROJECT_TEST_PLANS = 'tl.getProjectTestPlans' aeedb0e
  • create request: TPROJECT_TSUITES_FIRST_LEVEL = 'tl.getFirstLevelTestSuitesForTestProject' 0936e86
  • create request: TPLAN_BY_NAME = 'tl.getTestPlanByName' d7daea4
  • create request: TPLAN_PLATFORMS = 'tl.getTestPlanPlatforms' 295ca3d
  • create request: TPLAN_TOTALS = 'tl.getTotalsForTestPlan' 2d3314b
  • create request: TPLAN_BUILDS = 'tl.getBuildsForTestPlan' 40c22e2
  • create request: TPLAN_BUILD_LATEST = 'tl.getLatestBuildForTestPlan' da5f5ba
  • create request: TPLAN_TSUITES = 'tl.getTestSuitesForTestPlan' 0cf6604
  • create request: TPLAN_TCASES = 'tl.getTestCasesForTestPlan' c9b2638
  • create request: TSUITE_TSUITES = 'tl.getTestSuitesForTestSuite' 4e33a0e
  • create request: TSUITE_BY_ID = 'tl.getTestSuiteByID' 40b5c29
  • create request: TCASE_REPORT_RESULT = 'tl.reportTCResult' eb1c0c8
  • create request: TCASE_EXEC_RESULT = 'tl.setTestCaseExecutionResult' Just call to 'tl.reportTCResult', no sense develop this
  • create request: TCASE_ID_BY_NAME = 'tl.getTestCaseIDByName' 9979af1
  • create request: TCASE_BY_IDS = 'tl.getTestCase' 7bfff68
  • create request: TLINK_USER_EXIST = 'tl.doesUserExist' 88780fd
  • create request: TLINK_CHECK_DEV_KEY = 'tl.checkDevKey' 21adff3
  • create request: TLINK_ABOUT = 'tl.about' 47f51c6
  • create request: TLINK_TMODE_TOGGLE = 'tl.setTestMode' NOT full implemented by testlink, will develop at future
  • create request: TLINK_SAY_HELLO = 'tl.sayHello' f51deb6
  • create request: TLINK_PING = 'tl.ping' 01e6827
  • create request: TLINK_REPEAT = 'tl.repeat' 47fe30b

Issues related

Reviewers only

You can exec tests with python setup.py test

Rules before development

  • Debug on pytest will be activated on pytest.ini + prints on code until merge
  • All classes nomenclature can be changed if fix all code behind
  • All functionality can be modified on this PR, add or delete modules, classes, method, ALL
  • Ignore setup.py FIXs while development
  • Ignore utils module while development
  • Each request must be have 2 tests, 1 for reponse ok, 1 for response ko

Documentation:

method api_tproject_tsuites_first_level fail at use parameter as INT each of STR

Fail at use method api_tproject_tsuites_first_level with integer param, can't read response because it's failing , maybe need custom exception for this

>>> tsuites = tlm.api_tproject_tsuites_first_level('qalab')
2018-03-16 10:47:53,682 - qatestlink - INFO - POST request:
2018-03-16 10:47:53,818 - qatestlink - INFO - POST response:
2018-03-16 10:47:53,818 - qatestlink - INFO -     status_code=200
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "qatestlink/core/testlink_manager.py", line 193, in api_tproject_tsuites_first_level
    properties = data_properties['struct']['member']
TypeError: string indices must be integers
>>> tsuites = tlm.api_tproject_tsuites_first_level(1)
2018-03-16 10:48:08,091 - qatestlink - INFO - POST request:
2018-03-16 10:48:08,216 - qatestlink - INFO - POST response:
2018-03-16 10:48:08,216 - qatestlink - INFO -     status_code=200
>>> tsuites
[TSuite: id=3, name=qacode, parent_id=1, TSuite: id=4, name=qatestlink, parent_id=1, TSuite: id=5, name=qadmin, parent_id=1]
>>> dir(tsuites[0])
['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_load', '_properties', '_properties_bool', '_properties_int', 'active', 'convert_name', 'id', 'is_public', 'name', 'node_order', 'node_table', 'node_type_id', 'parent_id']
>>> 

[qatl] api_tprojects , fails when 1 alone tproject

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

api_tplan, Tplan model not load property , tproject_id

When Tplan model is loaded from call to api_tplan method

>>> tplan = tlm.api_tplan('qalab', 'v0.4.1')
2018-03-16 11:12:04,045 - qatestlink - INFO - POST request:
2018-03-16 11:12:04,182 - qatestlink - INFO - POST response:
2018-03-16 11:12:04,182 - qatestlink - INFO -     status_code=200
>>> tplan
TPlan: id=2, name=v0.4.1, is_public=True
>>> dir(tplan)
['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_load', '_properties', '_properties_bool', '_properties_int', 'active', 'api_key', 'convert_name', 'id', 'is_open', 'is_public', 'name', 'notes', 'testproject_id', 'tproject_id']
>>> tplan.testproject_id
1
>>> tplan.tproject_id
>>> tplan.id
2
>>> 

response formats

TODOs

  • handle member tags in response xml_str
    • 1st structure : (member > (name + value > string | int)) * **n**
    • 2nd structure : name + value > struct > (member > (name + value > string | int )) * **n**

Issues related

#21

notes

Maybe this doc note helps to fix old tests

class BaseHandler(object):
    def parse_node_value(self, node_value):
            # TODO: i don't know how to do this yet
            # different response for each request...
            # maybe ResponseMaybe class have no sense 
            # maybe must return dict always ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.