class JobDirectoryTestCase(TempDirectoryTestCase): def setUp(self): super(JobDirectoryTestCase, self).setUp() self.job_directory = JobDirectory(self.temp_directory, TEST_JOB_ID) def test_setup(self): expected_path = os.path.join(self.temp_directory, TEST_JOB_ID) assert not os.path.exists(expected_path) self.job_directory.setup() assert os.path.exists(expected_path) def test_metadata(self): self.prep() assert not self.job_directory.has_metadata("MooCow") self.job_directory.store_metadata("MooCow", True) assert self.job_directory.has_metadata("MooCow") def prep(self): self.job_directory.setup()
def setUp(self): super(JobDirectoryTestCase, self).setUp() self.job_directory = JobDirectory(self.temp_directory, TEST_JOB_ID)
def test_job_directory(): with temp_directory() as directory: yield JobDirectory(directory, '1')
def setup_temp_directory(self): self.temp_directory = mkdtemp() self.__job_directory = JobDirectory(self.temp_directory, '1')
def job_directory(self): return JobDirectory(self.temp_directory, '1')