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