Ejemplo n.º 1
0
 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)
Ejemplo n.º 2
0
 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)
Ejemplo n.º 3
0
 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
Ejemplo n.º 4
0
 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
Ejemplo n.º 5
0
 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
Ejemplo n.º 6
0
 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