Exemplo n.º 1
0
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 == []
Exemplo n.º 2
0
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 == []
Exemplo n.º 3
0
 def get(self):
     path = tmpdir.join(five.text(self.tmpdir_count)).strpath
     self.tmpdir_count += 1
     os.mkdir(path)
     return path
Exemplo n.º 4
0
def _to_bytes(exc):
    try:
        return bytes(exc)
    except Exception:
        return five.text(exc).encode('UTF-8')
Exemplo n.º 5
0
 def get(self):
     path = tmpdir.join(five.text(self.tmpdir_count)).strpath
     self.tmpdir_count += 1
     os.mkdir(path)
     return path
Exemplo n.º 6
0
 def get(self):
     path = os.path.join(tmpdir.strpath, five.text(self.tmpdir_count))
     self.tmpdir_count += 1
     os.mkdir(path)
     return path
Exemplo n.º 7
0
 def get(self):
     path = os.path.join(tmpdir.strpath, five.text(self.tmpdir_count))
     self.tmpdir_count += 1
     os.mkdir(path)
     return path
Exemplo n.º 8
0
def _to_bytes(exc):
    try:
        return bytes(exc)
    except Exception:
        return five.text(exc).encode('UTF-8')