diff options
author | Ike Devolder <ike.devolder@studioemma.eu> | 2017-03-23 15:33:37 +0100 |
---|---|---|
committer | Ike Devolder <ike.devolder@studioemma.eu> | 2017-03-23 15:33:37 +0100 |
commit | 2a8bd4fd45e0f2f5251ebd5760f54f77c8ee8781 (patch) | |
tree | b8ae62909d42fb2cf8eda27a13dfb31395971cae /tests | |
parent | 436bb4fb6d06c8b608e7410e8cde7a1ea8efa2ae (diff) | |
parent | 4c6a7caa10e32841dba86ba16acee30781388fdd (diff) | |
download | vdebug-2a8bd4fd45e0f2f5251ebd5760f54f77c8ee8781.zip |
Merge branch 'master' into v2-integration
* master:
Don't quote numeric keys in arrays
Add failing test for eval'd numeric array keys
Fix typo
Capitalize Vundle and add in-vim install method
Fix Vundle usage
Fixed type
Update Vundle instruction wording
Signed-off-by: Ike Devolder <ike.devolder@studioemma.eu>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_dbgp_eval_property.py | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/test_dbgp_eval_property.py b/tests/test_dbgp_eval_property.py new file mode 100644 index 0000000..32ab2fe --- /dev/null +++ b/tests/test_dbgp_eval_property.py @@ -0,0 +1,42 @@ +if __name__ == "__main__": + import sys + sys.path.append('../plugin/python/') +import unittest2 as unittest +import vdebug.dbgp +import xml.etree.ElementTree as ET + +class EvalPropertyTest(unittest.TestCase): + def __get_eval_property(self,xml_string,code,lang): + xml = ET.fromstring(xml_string) + firstnode = xml[0] + return vdebug.dbgp.EvalProperty(firstnode,code,lang) + + def test_numeric_keys(self): + prop = self.__get_eval_property(\ + """<?xml version="1.0" encoding="iso-8859-1"?> +<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="13"> + <property + address="140722906708544" type="array" + children="1" numchildren="2" page="0" pagesize="32"> + <property + name="0" address="140022315302704" + type="array" children="1" numchildren="1"></property> + <property + name="key" address="140022315307008" + type="array" children="1" numchildren="1"></property> + </property> +</response> +""", '$testarr', 'php') + + self.assertEqual(prop.display_name,'$testarr') + self.assertEqual(prop.value,'') + self.assertEqual(prop.type,'array') + self.assertEqual(prop.depth,0) + self.assertTrue(prop.has_children) + self.assertEqual(prop.child_count(),2) + + self.assertEqual(prop.children[0].type,'array') + self.assertEqual(prop.children[0].display_name,'$testarr[0]') + + self.assertEqual(prop.children[1].type,'array') + self.assertEqual(prop.children[1].display_name,"$testarr['key']") |