def test_empty(self, monkeypatch): """Test QStandardPaths returning an empty value.""" monkeypatch.setattr( 'qutebrowser.utils.standarddir.QStandardPaths.writableLocation', lambda typ: '') with pytest.raises(standarddir.EmptyValueError): standarddir._writable_location(QStandardPaths.DataLocation)
def test_empty(self, monkeypatch): """Test QStandardPaths returning an empty value.""" monkeypatch.setattr( 'qutebrowser.utils.standarddir.QStandardPaths.writableLocation', lambda typ: '') with pytest.raises(ValueError): standarddir._writable_location(QStandardPaths.DataLocation)
def test_sep(self, monkeypatch): """Make sure the right kind of separator is used.""" monkeypatch.setattr(standarddir.os, 'sep', '\\') monkeypatch.setattr(standarddir.os.path, 'join', lambda *parts: '\\'.join(parts)) loc = standarddir._writable_location(QStandardPaths.DataLocation) assert '/' not in loc assert '\\' in loc
def test_sep(self, monkeypatch): """Make sure the right kind of separator is used.""" monkeypatch.setattr('qutebrowser.utils.standarddir.os.sep', '\\') loc = standarddir._writable_location(QStandardPaths.DataLocation) assert '/' not in loc assert '\\' in loc