예제 #1
0
    def test_format_exceptions(self):
        ar = certlib.ActionReport()
        exc_list = [Exception("foo"), IOError("blip")]

        for exc in exc_list:
            ar._exceptions.append(exc)

        for exc in exc_list:
            self.assertTrue(exc in ar._exceptions)
예제 #2
0
    def test_format_exceptions(self):
        ar = certlib.ActionReport()
        exc_list = [
            Exception("foo"),
            IOError("blip"),
            Exception("HttpError(403) - Error in task 87a4cc11-f821-4a29-b289-b6f2411d96d2"),
        ]

        exc_list_formatted = ["foo", "blip", "Error in task 87a4cc11-f821-4a29-b289-b6f2411d96d2"]
        for exc in exc_list:
            ar._exceptions.append(exc)

        formatted = ar.format_exceptions()
        for exc in exc_list_formatted:
            self.assertTrue(exc in formatted)
        self.assertTrue("HttpError" not in formatted)
예제 #3
0
 def test(self):
     ar = certlib.ActionReport()
     self.assertEquals(None, ar._status)
     self.assertEquals([], ar._exceptions)
     self.assertEquals([], ar._updates)
     self.assertEquals("Report", ar.name)
예제 #4
0
    def __init__(self):
        self.cp_provider = inj.require(inj.CP_PROVIDER)
        self.uep = self.cp_provider.get_consumer_auth_cp()

        # Use the default report
        self.report = certlib.ActionReport()