コード例 #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)
コード例 #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)
コード例 #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
コード例 #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
コード例 #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
コード例 #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