def test_install_uninstall_htop_no_unknown_system(monkeypatch): def false(): return False monkeypatch.setattr(pywizard.resources.resource_package, 'os_ubuntu', false) monkeypatch.setattr(pywizard.resources.resource_package, 'os_centos', false) with pytest.raises(NotImplementedError): pw.package('htop')
def test_install_uninstall_htop(): htop = lambda: os.path.exists('/usr/bin/htop') assert not htop() file_resource = pw.package('htop') assert not htop() changes = file_resource.apply() assert not htop() changes[0].commit() assert htop() changes = file_resource.rollback() assert htop() changes[0].commit() assert not htop()