def test_correct_command(self, monkeypatch): run = Capture() monkeypatch.setattr(main.process, 'run', run) main.main(args=['ceph-volume-systemd', 'lvm-8715BEB4-15C5-49DE-BA6F-401086EC7B41-0' ]) command = run.calls[0][0] assert command == [ 'ceph-volume', 'lvm', 'trigger', '8715BEB4-15C5-49DE-BA6F-401086EC7B41-0' ]
def test_correct_command(self, monkeypatch): run = Capture() monkeypatch.setattr(main.process, 'run', run) main.main(args=[ 'ceph-volume-systemd', 'lvm-8715BEB4-15C5-49DE-BA6F-401086EC7B41-0' ]) command = run.calls[0][0] assert command == [ 'ceph-volume', 'lvm', 'trigger', '8715BEB4-15C5-49DE-BA6F-401086EC7B41-0' ]
def test_parsing_suffix_error(self): with pytest.raises(exceptions.SuffixParsingError): main.main(args=['asdf'])
def test_no_arguments_parsing_error(self): with pytest.raises(RuntimeError): main.main(args=[])