def test_unsupported_os(self, monkeypatch, tmpdir): def mock_expanduser(path): return tmpdir.join(path.replace('~', 'HOME')) monkeypatch.setattr(tools, 'is_linux', lambda x: False) monkeypatch.setattr(tools, 'is_osx', lambda x: False) monkeypatch.setattr(os.path, 'expanduser', mock_expanduser) p = JSSPrefs() assert p is not None
def jss_prefs(jss_prefs_file): # type: (str) -> JSSPrefs prefs = JSSPrefs(preferences_file=jss_prefs_file) return prefs
def test_configure_without_prefs(self, monkeypatch): # monkeypatch.setattr(__builtin__, 'raw_input', mock_raw_input) p = JSSPrefs() assert p is not None