def test_change_time(self): extra.touch(self.test_file) first_file_time = os.path.getmtime(self.test_file) sleep(0.01) extra.touch(self.test_file) second_file_time = os.path.getmtime(self.test_file) self.assertNotEqual(first_file_time, second_file_time)
def build(self): def copy_local_settings(): logger.info('Copying local settings...') sourc_path = '../local/settings.py' destination_path = './skysoccer/settings/local.py' shutil.copyfile(sourc_path, destination_path) #----------------------------------------------------------------------- copy_local_settings() touch(self.output_file)
def build(self): self.build_flag() touch(self.output_file)
def setUp(self): super(FindFilesTest, self).setUp() os.mkdir('first') os.mkdir('second') os.mkdir('third') extra.touch('file1.test') extra.touch('file2.test') extra.touch('file3.notest') for filename in ['file3.test', 'file4.test', 'file5.notest']: path = os.path.join('first', filename) extra.touch(path) for filename in ['file6.test', 'file7.test', 'file8.notest']: path = os.path.join('second', filename) extra.touch(path) for filename in ['file9.test', 'file10.test', 'file11.notest']: path = os.path.join('third', filename) extra.touch(path)
def test_new_file(self): actual_time = int(time()) extra.touch(self.test_file) file_time = int(os.path.getmtime(self.test_file)) self.assertTrue(os.path.exists(self.test_file)) self.assertEqual(actual_time, file_time)
def build(self): run_cmd(['./bin/buildout'], True) touch('./bin/py')
def touch(self, path, wait=0.01): if wait: sleep(wait) touch(path)