Fix unit tests after refactoring

This commit is contained in:
Florian Bruhin 2018-03-19 09:53:35 +01:00
parent a4530797ea
commit 232fd19422
2 changed files with 4 additions and 5 deletions

View File

@ -40,9 +40,7 @@ def test_big_cache_size(config_stub):
"""Make sure a too big cache size is handled correctly.""" """Make sure a too big cache size is handled correctly."""
config_stub.val.content.cache.size = 2 ** 63 - 1 config_stub.val.content.cache.size = 2 ** 63 - 1
profile = webenginesettings.default_profile profile = webenginesettings.default_profile
profile.setter.set_http_cache_size()
webenginesettings._set_http_cache_size(profile)
assert profile.httpCacheMaximumSize() == 2 ** 31 - 1 assert profile.httpCacheMaximumSize() == 2 ** 31 - 1

View File

@ -56,8 +56,9 @@ class StylesheetTester:
"""Initialize the stylesheet with a provided css file.""" """Initialize the stylesheet with a provided css file."""
css_path = os.path.join(os.path.dirname(__file__), css_file) css_path = os.path.join(os.path.dirname(__file__), css_file)
self.config_stub.val.content.user_stylesheets = css_path self.config_stub.val.content.user_stylesheets = css_path
p = QWebEngineProfile.defaultProfile() profile = QWebEngineProfile.defaultProfile()
webenginesettings._init_stylesheet(p) setter = webenginesettings.ProfileSetter(profile)
setter.init_stylesheet()
def set_css(self, css): def set_css(self, css):
"""Set document style to `css` via stylesheet.js.""" """Set document style to `css` via stylesheet.js."""