Exemplo n.º 1
0
 def test_read_cached_file(self, mocker, filename):
     utils.preload_resources()
     m = mocker.patch('pkg_resources.resource_string')
     utils.read_file(filename)
     m.assert_not_called()
Exemplo n.º 2
0
 def test_readfile_binary(self):
     """Read a test file in binary mode."""
     content = utils.read_file(os.path.join('utils', 'testfile'),
                               binary=True)
     assert content.splitlines()[0] == b"Hello World!"
Exemplo n.º 3
0
 def test_readfile(self):
     """Read a test file."""
     content = utils.read_file(os.path.join('utils', 'testfile'))
     assert content.splitlines()[0] == "Hello World!"
Exemplo n.º 4
0
 def test_readfile_binary(self):
     """Read a test file in binary mode."""
     content = utils.read_file(os.path.join('utils', 'testfile'),
                               binary=True)
     assert content.splitlines()[0] == b"Hello World!"
Exemplo n.º 5
0
 def test_readfile(self):
     """Read a test file."""
     content = utils.read_file(os.path.join('utils', 'testfile'))
     assert content.splitlines()[0] == "Hello World!"
Exemplo n.º 6
0
 def test_read_cached_file(self, mocker, filename):
     utils.preload_resources()
     m = mocker.patch('qutebrowser.utils.utils.importlib_resources.files')
     utils.read_file(filename)
     m.assert_not_called()
Exemplo n.º 7
0
 def test_read_cached_file(self, mocker, filename):
     utils.preload_resources()
     m = mocker.patch('pkg_resources.resource_string')
     utils.read_file(filename)
     m.assert_not_called()