Browse Source

[2823] updated open_template test for stats httpd with new mock class

JINMEI Tatuya 12 years ago
parent
commit
5ee0c3b143
1 changed files with 7 additions and 5 deletions
  1. 7 5
      src/bin/stats/tests/b10-stats-httpd_test.py

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

@@ -824,11 +824,11 @@ class TestStatsHttpd(unittest.TestCase):
         self.assertFalse(self.stats_httpd.running)
         self.assertEqual(None, self.stats_httpd.mccs)
 
-    @unittest.skipIf(True, 'tentatively skipped')
     def test_open_template(self):
-        self.stats_httpd = MyStatsHttpd(get_availaddr())
+        self.stats_httpd = SimpleStatsHttpd(get_availaddr())
         # successful conditions
-        tmpl = self.stats_httpd.open_template(stats_httpd.XML_TEMPLATE_LOCATION)
+        tmpl = self.stats_httpd.open_template(
+            stats_httpd.XML_TEMPLATE_LOCATION)
         self.assertTrue(isinstance(tmpl, string.Template))
         opts = dict(
             xml_string="<dummy></dummy>",
@@ -836,13 +836,15 @@ class TestStatsHttpd(unittest.TestCase):
         lines = tmpl.substitute(opts)
         for n in opts:
             self.assertGreater(lines.find(opts[n]), 0)
-        tmpl = self.stats_httpd.open_template(stats_httpd.XSD_TEMPLATE_LOCATION)
+        tmpl = self.stats_httpd.open_template(
+            stats_httpd.XSD_TEMPLATE_LOCATION)
         self.assertTrue(isinstance(tmpl, string.Template))
         opts = dict(xsd_namespace="http://host/path/to/")
         lines = tmpl.substitute(opts)
         for n in opts:
             self.assertGreater(lines.find(opts[n]), 0)
-        tmpl = self.stats_httpd.open_template(stats_httpd.XSL_TEMPLATE_LOCATION)
+        tmpl = self.stats_httpd.open_template(
+            stats_httpd.XSL_TEMPLATE_LOCATION)
         self.assertTrue(isinstance(tmpl, string.Template))
         opts = dict(xsd_namespace="http://host/path/to/")
         lines = tmpl.substitute(opts)