Beispiel #1
0
    def test_kill(self, tab, monkeypatch, fake_proc):
        monkeypatch.setitem(guiprocess.all_processes, 1234, fake_proc)

        guiprocess.process(tab, 1234, 'kill')
        fake_proc._proc.kill.assert_called_with()
        fake_proc._proc.terminate.assert_not_called()
Beispiel #2
0
 def test_cleaned_up_pid(self, tab, monkeypatch):
     monkeypatch.setitem(guiprocess.all_processes, 1337, None)
     with pytest.raises(cmdutils.CommandError,
                        match='Data for process 1337 got cleaned up'):
         guiprocess.process(tab, 1337)
Beispiel #3
0
 def test_inexistent_pid(self, tab):
     with pytest.raises(cmdutils.CommandError,
                        match='No process found with pid 1337'):
         guiprocess.process(tab, 1337)
Beispiel #4
0
    def test_explicit_pid(self, tab, monkeypatch, fake_proc):
        monkeypatch.setattr(guiprocess, 'last_pid', 1234)
        monkeypatch.setitem(guiprocess.all_processes, 5678, fake_proc)

        guiprocess.process(tab, 5678)
        assert tab.url() == QUrl('qute://process/5678')
Beispiel #5
0
    def test_last_pid(self, tab, monkeypatch, fake_proc):
        monkeypatch.setattr(guiprocess, 'last_pid', 1234)
        monkeypatch.setitem(guiprocess.all_processes, 1234, fake_proc)

        guiprocess.process(tab)
        assert tab.url() == QUrl('qute://process/1234')
Beispiel #6
0
 def test_no_process(self, tab, monkeypatch):
     monkeypatch.setattr(guiprocess, 'last_pid', None)
     with pytest.raises(cmdutils.CommandError,
                        match='No process executed yet!'):
         guiprocess.process(tab)