def test_basic_clone(self, monkeypatch): monkeypatch.setenv('HOME', FIXTURES_DIR) monkeypatch.setattr('subprocess.check_call', self.fake_check_call) clone = Clone(()) clone._run('mypkg') assert self.last_cmd == ['git', 'clone', 'ssh://[email protected]/ubuntu/mypkg']
def test_already_exists(self, tmpdir, monkeypatch): tmpdir.mkdir('mypkg') monkeypatch.chdir(tmpdir) clone = Clone(()) with pytest.raises(SystemExit): clone._run('mypkg')