예제 #1
0
 def test_get_usage_patterns_multi_elements_types_list(self):
     expected_results = [[int, str], [str, bool], [bool, int]]
     for x in range(len(self.multi_elements_types_list)):
         ret_val = XmlParser.get_usage_patterns(
             self.multi_elements_types_list[x])
         self.assertEqual(
             ret_val, expected_results[x]
         ), 'test_get_usage_patterns_multi_elements_types_list'
예제 #2
0
 def test_parse_commands_multi_commands_multi_elements(self):
     xml_parser = XmlParser(
         join(self.xmls_path, 'multi_commands_multi_elements.xml'))
     ret_val = [vars(x) for x in xml_parser.parse_commands()]
     self.assertEqual(ret_val, [vars(x) for x in self.multi_commands_multi_elements]), \
         'test_parse_commands_multi_commands_multi_elements'
예제 #3
0
 def test_parse_commands_one_command_one_element(self):
     xml_parser = XmlParser(
         join(self.xmls_path, 'one_command_one_element.xml'))
     ret_val = [vars(x) for x in xml_parser.parse_commands()]
     self.assertEqual(ret_val, [vars(x) for x in self.one_command_one_element]), \
         'test_parse_commands_one_command_one_element'
예제 #4
0
 def test_get_usage_patterns_empty_dict(self):
     self.assertEqual(XmlParser.get_usage_patterns(self.empty_dict),
                      []), 'test_get_usage_patterns_empty_dict'