Beispiel #1
0
 def getChild(self, path, req):
     if path == "logs":
         return LogsResource(self.step_status)
     return HtmlResource.getChild(self, path, req)
    def test_log_resource_xml_notests_in_content(self):
        logs_resource = LogsResource(
            self.setupStatus("test", "dfsd _nosetests", True))
        res = logs_resource.getChild("test", "")

        self.assertIsInstance(res, XMLTestResource)
    def test_log_resource_default(self):
        logs_resource = LogsResource(self.setupStatus("test", "", True))
        res = logs_resource.getChild("test", "")

        self.assertIsInstance(res, HTMLLog)
    def test_log_resource_xml_content(self):
        logs_resource = LogsResource(
            self.setupStatus("test", "<..><xml-stylesheet..!", True))
        res = logs_resource.getChild("test", "")

        self.assertIsInstance(res, XMLTestResource)
    def test_log_resource_xml(self):
        logs_resource = LogsResource(self.setupStatus("test", "", True, "xml"))
        res = logs_resource.getChild("test", "")

        self.assertIsInstance(res, XMLTestResource)
    def test_log_resource_json(self):
        st = self.setupStatus("test", "", True, "json")
        logs_resource = LogsResource(st)
        res = logs_resource.getChild("test", "")

        self.assertIsInstance(res, JSONTestResource)
    def test_log_resource_no_logs(self):
        logs_resource = LogsResource(self.setupStatus())
        res = logs_resource.getChild("test1", "")

        self.assertIsInstance(res, NoResource)
    def test_log_resource_no_html_log_file(self):
        logs_resource = LogsResource(
            self.setupStatus("test", "test content", True, html_log=False))
        res = logs_resource.getChild("test", "")

        self.assertIsInstance(res, TextLog)