コード例 #1
0
 def test_no_args(self, capsys):
     clone = Clone(['rhcephpkg'])
     with pytest.raises(SystemExit):
         clone.main()
     out, _ = capsys.readouterr()
     expected = clone._help + "\n"
     assert out == expected
コード例 #2
0
ファイル: test_clone.py プロジェクト: ktdreyer/rhcephpkg
 def test_no_args(self, capsys):
     clone = Clone(['rhcephpkg'])
     with pytest.raises(SystemExit):
         clone.main()
     out, _ = capsys.readouterr()
     expected = clone._help + "\n"
     assert out == expected
コード例 #3
0
 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']
コード例 #4
0
 def test_already_exists(self, tmpdir, monkeypatch):
     tmpdir.mkdir('mypkg')
     monkeypatch.chdir(tmpdir)
     clone = Clone(['rhcephpkg', 'mypkg'])
     with pytest.raises(SystemExit) as e:
         clone.main()
     expected = 'mypkg already exists in current working directory.'
     assert str(e.value) == expected
コード例 #5
0
ファイル: test_clone.py プロジェクト: ktdreyer/rhcephpkg
 def test_already_exists(self, tmpdir, monkeypatch):
     tmpdir.mkdir('mypkg')
     monkeypatch.chdir(tmpdir)
     clone = Clone(['rhcephpkg', 'mypkg'])
     with pytest.raises(SystemExit) as e:
         clone.main()
     expected = 'mypkg already exists in current working directory.'
     assert str(e.value) == expected
コード例 #6
0
ファイル: test_clone.py プロジェクト: ktdreyer/rhcephpkg
 def test_python_package(self, tmpdir, monkeypatch):
     recorder = CheckCallRecorder()
     monkeypatch.setattr('subprocess.check_call', recorder)
     monkeypatch.chdir(tmpdir)
     clone = Clone(['rhcephpkg', 'python-apipkg'])
     clone.main()
     assert recorder.args == ['git', 'clone',
                              'ssh://[email protected]/ubuntu/apipkg']
     assert tmpdir.join('apipkg').check(dir=1)
コード例 #7
0
 def test_python_package(self, tmpdir, monkeypatch):
     recorder = CheckCallRecorder()
     monkeypatch.setattr('subprocess.check_call', recorder)
     monkeypatch.chdir(tmpdir)
     clone = Clone(['rhcephpkg', 'python-apipkg'])
     clone.main()
     assert recorder.args == [
         'git', 'clone', 'ssh://[email protected]/ubuntu/apipkg'
     ]
     assert tmpdir.join('apipkg').check(dir=1)
コード例 #8
0
 def test_already_exists(self, tmpdir, monkeypatch):
     tmpdir.mkdir('mypkg')
     monkeypatch.chdir(tmpdir)
     clone = Clone(())
     with pytest.raises(SystemExit):
         clone._run('mypkg')