def testTarFilesInInputFiles(self): c1 = RunCommand() c1._create_tar_file([], {}) existing_files = TarCommand.get_existing_files() for f in existing_files: self.assertTrue(f in c1.get_input_files()) c2 = RunCommand() # this should not create a second tar file # since a "fresh" one exists c2._create_tar_file([], {}) existing_files = TarCommand.get_existing_files() for f in existing_files: self.assertTrue(f in c2.get_input_files())
def testCreateTar(self): c1 = RunCommand() c1._create_tar_file([], {}) existing_files = TarCommand.get_existing_files() self.assertTrue(len(existing_files) > 0) if not existing_files: return mtime1 = os.path.getmtime(existing_files[0]) c2 = RunCommand() # this should not create a second tar file # since a "fresh" one exists c2._create_tar_file([], {}) existing_files = TarCommand.get_existing_files() mtime2 = os.path.getmtime(existing_files[0]) self.assertEqual(mtime1, mtime2)