Exemplo n.º 1
0
 def __init__(self,
              name="Unnamed Test",
              pre_hook=None,
              test_params=None,
              post_hook=None,
              protocols=(HTTP, )):
     super(HTTPTest, self).__init__(name, pre_hook, test_params, post_hook,
                                    protocols)
     with self:
         # if any exception occurs, self.__exit__ will be immediately called
         self.server_setup()
         self.do_test()
         print_green('Test Passed.')
Exemplo n.º 2
0
 def begin(self):
     if not self.ready:
         # this is to maintain compatibility with scripts that
         # don't call setup()
         self.setup()
     with self:
         # If any exception occurs, self.__exit__ will be immediately called.
         # We must call the parent method in the end in order to verify
         # whether the tests succeeded or not.
         if self.ready:
             self.do_test()
             print_green("Test Passed.")
         else:
             self.tests_passed = False
         super(HTTPTest, self).begin()
Exemplo n.º 3
0
 def begin(self):
     if not self.ready:
         # this is to maintain compatibility with scripts that
         # don't call setup()
         self.setup()
     with self:
         # If any exception occurs, self.__exit__ will be immediately called.
         # We must call the parent method in the end in order to verify
         # whether the tests succeeded or not.
         if self.ready:
             self.do_test()
             print_green("Test Passed.")
         else:
             self.tests_passed = False
         super(HTTPTest, self).begin()
Exemplo n.º 4
0
 def __init__(self,
              name="Unnamed Test",
              pre_hook=None,
              test_params=None,
              post_hook=None,
              protocols=(HTTP,)):
     super(HTTPTest, self).__init__(name,
                                    pre_hook,
                                    test_params,
                                    post_hook,
                                    protocols)
     with self:
         # if any exception occurs, self.__exit__ will be immediately called
         self.server_setup()
         self.do_test()
         print_green('Test Passed.')