Ejemplo n.º 1
0
 def test_copy_log_naarad_logs_speced_per_id(self):
   """
   Create a single log file and set "naarad_logs" method to return
   this file and test that is gets copied as expected
   """    #first set things up
   #create a temp dir for logs
   import tempfile
   localhost_logs_dir = tempfile.mkdtemp()
   try:
     localhost_log_file = os.path.join(localhost_logs_dir, "unittest.log")
     ztestsuite = SampleTestSuite(Mock_Deployer())
     ztestsuite.naarad_logs = lambda unique_id: [localhost_log_file]
     self.__test_copy_log_speced_per_id(ztestsuite, localhost_log_file)
   finally:
     #cleanup
     shutil.rmtree( localhost_logs_dir)
Ejemplo n.º 2
0
 def test_copy_log_naarad_logs_speced_per_id(self):
     """
 Create a single log file and set "naarad_logs" method to return
 this file and test that is gets copied as expected
 """    #first set things up
     #create a temp dir for logs
     import tempfile
     localhost_logs_dir = tempfile.mkdtemp()
     try:
         localhost_log_file = os.path.join(localhost_logs_dir,
                                           "unittest.log")
         ztestsuite = SampleTestSuite(Mock_Deployer())
         ztestsuite.naarad_logs = lambda unique_id: [localhost_log_file]
         self.__test_copy_log_speced_per_id(ztestsuite, localhost_log_file,
                                            False)
     finally:
         #cleanup
         shutil.rmtree(localhost_logs_dir)
Ejemplo n.º 3
0
 def test_copy_log_naarad_logs_deprecated(self):
     """
 Create a single log file and set "naarad_logs" method
 with DEPRECATED signature to return
 this file and test that is gets copied as expected
 """
     #first set things up
     #create a temp dir for logs
     import tempfile
     localhost_logs_dir = tempfile.mkdtemp()
     try:
         localhost_log_file = os.path.join(localhost_logs_dir,
                                           "unittest.log")
         ztestsuite = SampleTestSuite(Mock_Deployer())
         ztestsuite.naarad_logs = lambda: {
             "ztestsuite.unittest": [localhost_log_file]
         }
         self.__test_copy_logs_deprecated(ztestsuite, localhost_log_file)
     finally:
         #cleanup
         shutil.rmtree(localhost_logs_dir)