Exemplo n.º 1
0
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()
Exemplo n.º 2
0
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()
Exemplo n.º 3
0
def test_job_directory():
    with temp_directory() as directory:
        yield JobDirectory(directory, '1')
Exemplo n.º 4
0
 def setup_temp_directory(self):
     self.temp_directory = mkdtemp()
     self.__job_directory = JobDirectory(self.temp_directory, '1')
Exemplo n.º 5
0
 def setup_temp_directory(self):
     self.temp_directory = temp_directory_persist(prefix='test_manager_')
     self.__job_directory = JobDirectory(self.temp_directory, '1')
Exemplo n.º 6
0
def test_job_directory():
    with temp_directory(prefix='job_') as directory:
        yield JobDirectory(directory, '1')
Exemplo n.º 7
0
 def setUp(self):
     super(JobDirectoryTestCase, self).setUp()
     self.job_directory = JobDirectory(self.temp_directory, TEST_JOB_ID)
Exemplo n.º 8
0
 def job_directory(self):
     return JobDirectory(self.temp_directory, '1')
Exemplo n.º 9
0
 def setUp(self):
     super(JobDirectoryTestCase, self).setUp()
     self.job_directory = JobDirectory(self.temp_directory, TEST_JOB_ID)