Browse Source

[2298_7] add checking of the two same lists

check whether the list of 'identifier' attributes in root is same
as the list of item names in DUMMY_DATA
Naoki Kambe 12 years ago
parent
commit
3f070f48b0
1 changed files with 7 additions and 0 deletions
  1. 7 0
      src/bin/stats/tests/b10-stats-httpd_test.py

+ 7 - 0
src/bin/stats/tests/b10-stats-httpd_test.py

@@ -253,6 +253,13 @@ class TestHttpHandler(unittest.TestCase):
                     '<?xml-stylesheet type="text/xsl" href="' + 
                     stats_httpd.XSL_URL_PATH
                     + '"?>'))
+            # check whether the list of 'identifier' attributes in
+            # root is same as the list of item names in DUMMY_DATA
+            id_list = [ elm.attrib['identifier'] for elm in root ]
+            item_list = [ it for it in \
+                              stats_httpd.item_name_list(DUMMY_DATA, path) \
+                              if len(it.split('/')) > 1 ]
+            self.assertEqual(id_list, item_list)
             for elem in root:
                 attr = elem.attrib
                 value = isc.cc.data.find(DUMMY_DATA, attr['identifier'])