def test_clone_cleans_up_on_checkout_failure(store): try: # This raises an exception because you can't clone something that # doesn't exist! store.clone('/i_dont_exist_lol', 'fake_sha') except Exception as e: assert '/i_dont_exist_lol' in five.text(e) things_starting_with_repo = [ thing for thing in os.listdir(store.directory) if thing.startswith('repo') ] assert things_starting_with_repo == []
def get(self): path = tmpdir.join(five.text(self.tmpdir_count)).strpath self.tmpdir_count += 1 os.mkdir(path) return path
def _to_bytes(exc): try: return bytes(exc) except Exception: return five.text(exc).encode('UTF-8')
def get(self): path = os.path.join(tmpdir.strpath, five.text(self.tmpdir_count)) self.tmpdir_count += 1 os.mkdir(path) return path