def test_cd(self): root = current_directory() self.fs.CreateDirectory(os.path.join('tmp', 'a', 'b')) with cd(os.path.join('tmp', 'a')) as a: self.assertEqual(current_directory(), os.path.join(root, 'tmp', 'a')) with cd('b') as b: self.assertEqual(current_directory(), os.path.join(root, 'tmp', 'a', 'b'))
def test_relative_path(self): with cd(self.path()): os.mkdir('rel') self.prepare_needs('rel') self.do_clean_and_build()
def execute(self, command): with cd(self.path()): return main(['needy'] + command)