From ec06247327c061761b426d71f9e3356b3ccc05f8 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 11 Dec 2015 07:49:33 +0100 Subject: [PATCH] Add tests to check upgrades from old configs. See #1171. --- CONTRIBUTING.asciidoc | 5 +- .../old_configs/qutebrowser-v0.1.0.conf | 180 ++++++++++++++ .../old_configs/qutebrowser-v0.1.1.conf | 181 ++++++++++++++ .../old_configs/qutebrowser-v0.1.2.conf | 181 ++++++++++++++ .../old_configs/qutebrowser-v0.1.4.conf | 176 ++++++++++++++ .../old_configs/qutebrowser-v0.2.0.conf | 200 ++++++++++++++++ .../old_configs/qutebrowser-v0.3.0.conf | 221 +++++++++++++++++ .../old_configs/qutebrowser-v0.4.0.conf | 226 ++++++++++++++++++ tests/unit/config/test_config.py | 26 ++ 9 files changed, 1392 insertions(+), 4 deletions(-) create mode 100644 tests/unit/config/old_configs/qutebrowser-v0.1.0.conf create mode 100644 tests/unit/config/old_configs/qutebrowser-v0.1.1.conf create mode 100644 tests/unit/config/old_configs/qutebrowser-v0.1.2.conf create mode 100644 tests/unit/config/old_configs/qutebrowser-v0.1.4.conf create mode 100644 tests/unit/config/old_configs/qutebrowser-v0.2.0.conf create mode 100644 tests/unit/config/old_configs/qutebrowser-v0.3.0.conf create mode 100644 tests/unit/config/old_configs/qutebrowser-v0.4.0.conf diff --git a/CONTRIBUTING.asciidoc b/CONTRIBUTING.asciidoc index 3655f4bc6..204a5e40b 100644 --- a/CONTRIBUTING.asciidoc +++ b/CONTRIBUTING.asciidoc @@ -561,13 +561,10 @@ qutebrowser release * Make sure there are no unstaged changes. * Run `src2asciidoc.py` and commit changes if necessary. -* Run all tests on all supported systems. -* Test an upgrade from the previous version (no manual intervention). -* Test an upgrade from the first version (no manual intervention). - * Run `asciidoc2html.py`. * Adjust `__version_info__` in `qutebrowser/__init__.py`. * Remove *(unreleased)* from changelog. +* Run all tests on all supported systems. * Commit * Create annotated git tag (`git tag -s "v0.X.Y" -m "Release v0.X.Y"`) diff --git a/tests/unit/config/old_configs/qutebrowser-v0.1.0.conf b/tests/unit/config/old_configs/qutebrowser-v0.1.0.conf new file mode 100644 index 000000000..5a6435c5e --- /dev/null +++ b/tests/unit/config/old_configs/qutebrowser-v0.1.0.conf @@ -0,0 +1,180 @@ + + +[general] +ignore-case = smart +wrap-search = true +startpage = https://www.duckduckgo.com +auto-search = naive +auto-save-config = true +editor = gvim -f "{}" +editor-encoding = utf-8 +private-browsing = false +developer-extras = false +print-element-backgrounds = true +xss-auditing = false +site-specific-quirks = true +default-encoding = +new-instance-open-target = window + +[ui] +zoom-levels = 25%,33%,50%,67%,75%,90%,100%,110%,125%,150%,175%,200%,250%,300%,400%,500% +default-zoom = 100% +message-timeout = 2000 +confirm-quit = never +display-statusbar-messages = false +zoom-text-only = false +frame-flattening = false +user-stylesheet = ::-webkit-scrollbar { width: 0px; height: 0px; } +css-media-type = +remove-finished-downloads = false + +[network] +do-not-track = true +accept-language = en-US,en +user-agent = +proxy = system +ssl-strict = ask +dns-prefetch = true + +[completion] +show = true +height = 50% +history-length = 100 +quick-complete = true +shrink = false + +[input] +timeout = 500 +insert-mode-on-plugins = false +auto-leave-insert-mode = true +auto-insert-mode = false +forward-unbound-keys = auto +spatial-navigation = false +links-included-in-focus-chain = true + +[tabs] +background-tabs = false +select-on-remove = right +new-tab-position = right +new-tab-position-explicit = last +last-close = ignore +auto-hide = false +wrap = true +movable = true +close-mouse-button = middle +position = north +show-favicons = true +width = 20% +indicator-width = 3 +indicator-space = 3 +tabs-are-windows = false + +[storage] +download-directory = +maximum-pages-in-cache = +object-cache-capacities = +offline-storage-default-quota = +offline-web-application-cache-quota = +offline-storage-database = true +offline-web-application-storage = true +local-storage = true +cache-size = 52428800 + +[content] +allow-images = true +allow-javascript = true +allow-plugins = false +javascript-can-open-windows = false +javascript-can-close-windows = false +javascript-can-access-clipboard = false +local-content-can-access-remote-urls = false +local-content-can-access-file-urls = true +cookies-accept = default +cookies-store = true +host-block-lists = http://www.malwaredomainlist.com/hostslist/hosts.txt,http://someonewhocares.org/hosts/hosts,http://winhelp2002.mvps.org/hosts.zip,http://malwaredomains.lehigh.edu/files/justdomains.zip,http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext,http://hosts-file.net/ad_servers.asp + +[hints] +border = 1px solid #E3BE23 +opacity = 0.7 +mode = letter +chars = asdfghjkl +uppercase = false +auto-follow = true +next-regexes = \bnext\b,\bmore\b,\bnewer\b,\b[>→≫]\b,\b(>>|»)\b +prev-regexes = \bprev(ious)?\b,\bback\b,\bolder\b,\b[<←≪]\b,\b(<<|«)\b + +[searchengines] +DEFAULT = ${duckduckgo} +duckduckgo = https://duckduckgo.com/?q={} +ddg = ${duckduckgo} +google = https://encrypted.google.com/search?q={} +g = ${google} +wikipedia = http://en.wikipedia.org/w/index.php?title=Special:Search&search={} +wiki = ${wikipedia} + +[aliases] + +[colors] +completion.fg = white +completion.bg = #333333 +completion.item.bg = ${completion.bg} +completion.category.fg = white +completion.category.bg = qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #888888, stop:1 #505050) +completion.category.border.top = black +completion.category.border.bottom = ${completion.category.border.top} +completion.item.selected.fg = black +completion.item.selected.bg = #e8c000 +completion.item.selected.border.top = #bbbb00 +completion.item.selected.border.bottom = ${completion.item.selected.border.top} +completion.match.fg = #ff4444 +statusbar.bg = black +statusbar.fg = white +statusbar.bg.error = red +statusbar.bg.prompt = darkblue +statusbar.bg.insert = darkgreen +statusbar.progress.bg = white +statusbar.url.fg = ${statusbar.fg} +statusbar.url.fg.success = lime +statusbar.url.fg.error = orange +statusbar.url.fg.warn = yellow +statusbar.url.fg.hover = aqua +tabs.fg.odd = white +tabs.fg.even = white +tabs.fg.selected = white +tabs.bg.odd = grey +tabs.bg.even = darkgrey +tabs.bg.selected = black +tabs.bg.bar = #555555 +tabs.indicator.start = #0000aa +tabs.indicator.stop = #00aa00 +tabs.indicator.error = #ff0000 +tabs.indicator.system = rgb +tabs.seperator = #555555 +hints.fg = black +hints.fg.match = green +hints.bg = -webkit-gradient(linear, left top, left bottom, color-stop(0%,#FFF785), color-stop(100%,#FFC542)) +downloads.fg = #ffffff +downloads.bg.bar = black +downloads.bg.start = #0000aa +downloads.bg.stop = #00aa00 +downloads.bg.system = rgb +downloads.bg.error = red + +[fonts] +_monospace = Terminus, Monospace, "DejaVu Sans Mono", Monaco, "Bitstream Vera Sans Mono", "Andale Mono", "Liberation Mono", "Courier New", Courier, monospace, Fixed, Consolas, Terminal +completion = 8pt ${_monospace} +tabbar = 8pt ${_monospace} +statusbar = 8pt ${_monospace} +downloads = 8pt ${_monospace} +hints = bold 12px Monospace +debug-console = 8pt ${_monospace} +web-family-standard = +web-family-fixed = +web-family-serif = +web-family-sans-serif = +web-family-cursive = +web-family-fantasy = +web-size-minimum = +web-size-minimum-logical = +web-size-default = +web-size-default-fixed = diff --git a/tests/unit/config/old_configs/qutebrowser-v0.1.1.conf b/tests/unit/config/old_configs/qutebrowser-v0.1.1.conf new file mode 100644 index 000000000..8796fad6c --- /dev/null +++ b/tests/unit/config/old_configs/qutebrowser-v0.1.1.conf @@ -0,0 +1,181 @@ + + +[general] +ignore-case = smart +wrap-search = true +startpage = https://www.duckduckgo.com +auto-search = naive +auto-save-config = true +editor = gvim -f "{}" +editor-encoding = utf-8 +private-browsing = false +developer-extras = false +print-element-backgrounds = true +xss-auditing = false +site-specific-quirks = true +default-encoding = +new-instance-open-target = window + +[ui] +zoom-levels = 25%,33%,50%,67%,75%,90%,100%,110%,125%,150%,175%,200%,250%,300%,400%,500% +default-zoom = 100% +message-timeout = 2000 +confirm-quit = never +display-statusbar-messages = false +zoom-text-only = false +frame-flattening = false +user-stylesheet = ::-webkit-scrollbar { width: 0px; height: 0px; } +css-media-type = +remove-finished-downloads = false + +[network] +do-not-track = true +accept-language = en-US,en +user-agent = +proxy = system +proxy-dns-requests = true +ssl-strict = ask +dns-prefetch = true + +[completion] +show = true +height = 50% +history-length = 100 +quick-complete = true +shrink = false + +[input] +timeout = 500 +insert-mode-on-plugins = false +auto-leave-insert-mode = true +auto-insert-mode = false +forward-unbound-keys = auto +spatial-navigation = false +links-included-in-focus-chain = true + +[tabs] +background-tabs = false +select-on-remove = right +new-tab-position = right +new-tab-position-explicit = last +last-close = ignore +auto-hide = false +wrap = true +movable = true +close-mouse-button = middle +position = north +show-favicons = true +width = 20% +indicator-width = 3 +indicator-space = 3 +tabs-are-windows = false + +[storage] +download-directory = +maximum-pages-in-cache = +object-cache-capacities = +offline-storage-default-quota = +offline-web-application-cache-quota = +offline-storage-database = true +offline-web-application-storage = true +local-storage = true +cache-size = 52428800 + +[content] +allow-images = true +allow-javascript = true +allow-plugins = false +javascript-can-open-windows = false +javascript-can-close-windows = false +javascript-can-access-clipboard = false +local-content-can-access-remote-urls = false +local-content-can-access-file-urls = true +cookies-accept = default +cookies-store = true +host-block-lists = http://www.malwaredomainlist.com/hostslist/hosts.txt,http://someonewhocares.org/hosts/hosts,http://winhelp2002.mvps.org/hosts.zip,http://malwaredomains.lehigh.edu/files/justdomains.zip,http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext,http://hosts-file.net/ad_servers.asp + +[hints] +border = 1px solid #E3BE23 +opacity = 0.7 +mode = letter +chars = asdfghjkl +uppercase = false +auto-follow = true +next-regexes = \bnext\b,\bmore\b,\bnewer\b,\b[>→≫]\b,\b(>>|»)\b +prev-regexes = \bprev(ious)?\b,\bback\b,\bolder\b,\b[<←≪]\b,\b(<<|«)\b + +[searchengines] +DEFAULT = ${duckduckgo} +duckduckgo = https://duckduckgo.com/?q={} +ddg = ${duckduckgo} +google = https://encrypted.google.com/search?q={} +g = ${google} +wikipedia = http://en.wikipedia.org/w/index.php?title=Special:Search&search={} +wiki = ${wikipedia} + +[aliases] + +[colors] +completion.fg = white +completion.bg = #333333 +completion.item.bg = ${completion.bg} +completion.category.fg = white +completion.category.bg = qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #888888, stop:1 #505050) +completion.category.border.top = black +completion.category.border.bottom = ${completion.category.border.top} +completion.item.selected.fg = black +completion.item.selected.bg = #e8c000 +completion.item.selected.border.top = #bbbb00 +completion.item.selected.border.bottom = ${completion.item.selected.border.top} +completion.match.fg = #ff4444 +statusbar.bg = black +statusbar.fg = white +statusbar.bg.error = red +statusbar.bg.prompt = darkblue +statusbar.bg.insert = darkgreen +statusbar.progress.bg = white +statusbar.url.fg = ${statusbar.fg} +statusbar.url.fg.success = lime +statusbar.url.fg.error = orange +statusbar.url.fg.warn = yellow +statusbar.url.fg.hover = aqua +tabs.fg.odd = white +tabs.fg.even = white +tabs.fg.selected = white +tabs.bg.odd = grey +tabs.bg.even = darkgrey +tabs.bg.selected = black +tabs.bg.bar = #555555 +tabs.indicator.start = #0000aa +tabs.indicator.stop = #00aa00 +tabs.indicator.error = #ff0000 +tabs.indicator.system = rgb +tabs.seperator = #555555 +hints.fg = black +hints.fg.match = green +hints.bg = -webkit-gradient(linear, left top, left bottom, color-stop(0%,#FFF785), color-stop(100%,#FFC542)) +downloads.fg = #ffffff +downloads.bg.bar = black +downloads.bg.start = #0000aa +downloads.bg.stop = #00aa00 +downloads.bg.system = rgb +downloads.bg.error = red + +[fonts] +_monospace = Terminus, Monospace, "DejaVu Sans Mono", Monaco, "Bitstream Vera Sans Mono", "Andale Mono", "Liberation Mono", "Courier New", Courier, monospace, Fixed, Consolas, Terminal +completion = 8pt ${_monospace} +tabbar = 8pt ${_monospace} +statusbar = 8pt ${_monospace} +downloads = 8pt ${_monospace} +hints = bold 12px Monospace +debug-console = 8pt ${_monospace} +web-family-standard = +web-family-fixed = +web-family-serif = +web-family-sans-serif = +web-family-cursive = +web-family-fantasy = +web-size-minimum = +web-size-minimum-logical = +web-size-default = +web-size-default-fixed = diff --git a/tests/unit/config/old_configs/qutebrowser-v0.1.2.conf b/tests/unit/config/old_configs/qutebrowser-v0.1.2.conf new file mode 100644 index 000000000..d3a71b09f --- /dev/null +++ b/tests/unit/config/old_configs/qutebrowser-v0.1.2.conf @@ -0,0 +1,181 @@ + + +[general] +ignore-case = smart +wrap-search = true +startpage = https://www.duckduckgo.com +auto-search = naive +auto-save-config = true +editor = gvim -f "{}" +editor-encoding = utf-8 +private-browsing = false +developer-extras = false +print-element-backgrounds = true +xss-auditing = false +site-specific-quirks = true +default-encoding = +new-instance-open-target = window + +[ui] +zoom-levels = 25%,33%,50%,67%,75%,90%,100%,110%,125%,150%,175%,200%,250%,300%,400%,500% +default-zoom = 100% +message-timeout = 2000 +confirm-quit = never +display-statusbar-messages = false +zoom-text-only = false +frame-flattening = false +user-stylesheet = ::-webkit-scrollbar { width: 0px; height: 0px; } +css-media-type = +remove-finished-downloads = false + +[network] +do-not-track = true +accept-language = en-US,en +user-agent = +proxy = system +proxy-dns-requests = true +ssl-strict = ask +dns-prefetch = true + +[completion] +show = true +height = 50% +history-length = 100 +quick-complete = true +shrink = false + +[input] +timeout = 500 +insert-mode-on-plugins = false +auto-leave-insert-mode = true +auto-insert-mode = false +forward-unbound-keys = auto +spatial-navigation = false +links-included-in-focus-chain = true + +[tabs] +background-tabs = false +select-on-remove = right +new-tab-position = right +new-tab-position-explicit = last +last-close = ignore +auto-hide = false +wrap = true +movable = true +close-mouse-button = middle +position = north +show-favicons = true +width = 20% +indicator-width = 3 +indicator-space = 3 +tabs-are-windows = false + +[storage] +download-directory = +maximum-pages-in-cache = +object-cache-capacities = +offline-storage-default-quota = +offline-web-application-cache-quota = +offline-storage-database = true +offline-web-application-storage = true +local-storage = true +cache-size = 52428800 + +[content] +allow-images = true +allow-javascript = true +allow-plugins = false +javascript-can-open-windows = false +javascript-can-close-windows = false +javascript-can-access-clipboard = false +local-content-can-access-remote-urls = false +local-content-can-access-file-urls = true +cookies-accept = default +cookies-store = true +host-block-lists = http://www.malwaredomainlist.com/hostslist/hosts.txt,http://someonewhocares.org/hosts/hosts,http://winhelp2002.mvps.org/hosts.zip,http://malwaredomains.lehigh.edu/files/justdomains.zip,http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext + +[hints] +border = 1px solid #E3BE23 +opacity = 0.7 +mode = letter +chars = asdfghjkl +uppercase = false +auto-follow = true +next-regexes = \bnext\b,\bmore\b,\bnewer\b,\b[>→≫]\b,\b(>>|»)\b +prev-regexes = \bprev(ious)?\b,\bback\b,\bolder\b,\b[<←≪]\b,\b(<<|«)\b + +[searchengines] +DEFAULT = ${duckduckgo} +duckduckgo = https://duckduckgo.com/?q={} +ddg = ${duckduckgo} +google = https://encrypted.google.com/search?q={} +g = ${google} +wikipedia = http://en.wikipedia.org/w/index.php?title=Special:Search&search={} +wiki = ${wikipedia} + +[aliases] + +[colors] +completion.fg = white +completion.bg = #333333 +completion.item.bg = ${completion.bg} +completion.category.fg = white +completion.category.bg = qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #888888, stop:1 #505050) +completion.category.border.top = black +completion.category.border.bottom = ${completion.category.border.top} +completion.item.selected.fg = black +completion.item.selected.bg = #e8c000 +completion.item.selected.border.top = #bbbb00 +completion.item.selected.border.bottom = ${completion.item.selected.border.top} +completion.match.fg = #ff4444 +statusbar.bg = black +statusbar.fg = white +statusbar.bg.error = red +statusbar.bg.prompt = darkblue +statusbar.bg.insert = darkgreen +statusbar.progress.bg = white +statusbar.url.fg = ${statusbar.fg} +statusbar.url.fg.success = lime +statusbar.url.fg.error = orange +statusbar.url.fg.warn = yellow +statusbar.url.fg.hover = aqua +tabs.fg.odd = white +tabs.fg.even = white +tabs.fg.selected = white +tabs.bg.odd = grey +tabs.bg.even = darkgrey +tabs.bg.selected = black +tabs.bg.bar = #555555 +tabs.indicator.start = #0000aa +tabs.indicator.stop = #00aa00 +tabs.indicator.error = #ff0000 +tabs.indicator.system = rgb +tabs.seperator = #555555 +hints.fg = black +hints.fg.match = green +hints.bg = -webkit-gradient(linear, left top, left bottom, color-stop(0%,#FFF785), color-stop(100%,#FFC542)) +downloads.fg = #ffffff +downloads.bg.bar = black +downloads.bg.start = #0000aa +downloads.bg.stop = #00aa00 +downloads.bg.system = rgb +downloads.bg.error = red + +[fonts] +_monospace = Terminus, Monospace, "DejaVu Sans Mono", Monaco, "Bitstream Vera Sans Mono", "Andale Mono", "Liberation Mono", "Courier New", Courier, monospace, Fixed, Consolas, Terminal +completion = 8pt ${_monospace} +tabbar = 8pt ${_monospace} +statusbar = 8pt ${_monospace} +downloads = 8pt ${_monospace} +hints = bold 12px Monospace +debug-console = 8pt ${_monospace} +web-family-standard = +web-family-fixed = +web-family-serif = +web-family-sans-serif = +web-family-cursive = +web-family-fantasy = +web-size-minimum = +web-size-minimum-logical = +web-size-default = +web-size-default-fixed = diff --git a/tests/unit/config/old_configs/qutebrowser-v0.1.4.conf b/tests/unit/config/old_configs/qutebrowser-v0.1.4.conf new file mode 100644 index 000000000..9cac158f6 --- /dev/null +++ b/tests/unit/config/old_configs/qutebrowser-v0.1.4.conf @@ -0,0 +1,176 @@ + + +[general] +ignore-case = smart +wrap-search = true +startpage = https://www.duckduckgo.com +auto-search = naive +auto-save-config = true +editor = gvim -f "{}" +editor-encoding = utf-8 +private-browsing = false +developer-extras = false +print-element-backgrounds = true +xss-auditing = false +site-specific-quirks = true +default-encoding = +new-instance-open-target = window +log-javascript-console = false + +[ui] +zoom-levels = 25%,33%,50%,67%,75%,90%,100%,110%,125%,150%,175%,200%,250%,300%,400%,500% +default-zoom = 100% +message-timeout = 2000 +confirm-quit = never +display-statusbar-messages = false +zoom-text-only = false +frame-flattening = false +user-stylesheet = ::-webkit-scrollbar { width: 0px; height: 0px; } +css-media-type = +remove-finished-downloads = false + +[network] +do-not-track = true +accept-language = en-US,en +user-agent = +proxy = system +proxy-dns-requests = true +ssl-strict = ask +dns-prefetch = true + +[completion] +show = true +height = 50% +history-length = 100 +quick-complete = true +shrink = false + +[input] +timeout = 500 +insert-mode-on-plugins = false +auto-leave-insert-mode = true +auto-insert-mode = false +forward-unbound-keys = auto +spatial-navigation = false +links-included-in-focus-chain = true + +[tabs] +background-tabs = false +select-on-remove = right +new-tab-position = right +new-tab-position-explicit = last +last-close = ignore +auto-hide = false +wrap = true +movable = true +close-mouse-button = middle +position = north +show-favicons = true +width = 20% +indicator-width = 3 +indicator-space = 3 +tabs-are-windows = false + +[storage] +download-directory = +maximum-pages-in-cache = +object-cache-capacities = +offline-storage-default-quota = +offline-web-application-cache-quota = +offline-storage-database = true +offline-web-application-storage = true +local-storage = true +cache-size = 52428800 + +[content] +allow-images = true +allow-javascript = true +allow-plugins = false +javascript-can-open-windows = false +javascript-can-close-windows = false +javascript-can-access-clipboard = false +local-content-can-access-remote-urls = false +local-content-can-access-file-urls = true +cookies-accept = default +cookies-store = true +host-block-lists = http://www.malwaredomainlist.com/hostslist/hosts.txt,http://someonewhocares.org/hosts/hosts,http://winhelp2002.mvps.org/hosts.zip,http://malwaredomains.lehigh.edu/files/justdomains.zip,http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext + +[hints] +border = 1px solid #E3BE23 +opacity = 0.7 +mode = letter +chars = asdfghjkl +uppercase = false +auto-follow = true +next-regexes = \bnext\b,\bmore\b,\bnewer\b,\b[>→≫]\b,\b(>>|»)\b +prev-regexes = \bprev(ious)?\b,\bback\b,\bolder\b,\b[<←≪]\b,\b(<<|«)\b + +[searchengines] +DEFAULT = https://duckduckgo.com/?q={} + +[aliases] + +[colors] +completion.fg = white +completion.bg = #333333 +completion.item.bg = ${completion.bg} +completion.category.fg = white +completion.category.bg = qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #888888, stop:1 #505050) +completion.category.border.top = black +completion.category.border.bottom = ${completion.category.border.top} +completion.item.selected.fg = black +completion.item.selected.bg = #e8c000 +completion.item.selected.border.top = #bbbb00 +completion.item.selected.border.bottom = ${completion.item.selected.border.top} +completion.match.fg = #ff4444 +statusbar.bg = black +statusbar.fg = white +statusbar.bg.error = red +statusbar.bg.prompt = darkblue +statusbar.bg.insert = darkgreen +statusbar.progress.bg = white +statusbar.url.fg = ${statusbar.fg} +statusbar.url.fg.success = lime +statusbar.url.fg.error = orange +statusbar.url.fg.warn = yellow +statusbar.url.fg.hover = aqua +tabs.fg.odd = white +tabs.fg.even = white +tabs.fg.selected = white +tabs.bg.odd = grey +tabs.bg.even = darkgrey +tabs.bg.selected = black +tabs.bg.bar = #555555 +tabs.indicator.start = #0000aa +tabs.indicator.stop = #00aa00 +tabs.indicator.error = #ff0000 +tabs.indicator.system = rgb +tabs.seperator = #555555 +hints.fg = black +hints.fg.match = green +hints.bg = -webkit-gradient(linear, left top, left bottom, color-stop(0%,#FFF785), color-stop(100%,#FFC542)) +downloads.fg = #ffffff +downloads.bg.bar = black +downloads.bg.start = #0000aa +downloads.bg.stop = #00aa00 +downloads.bg.system = rgb +downloads.bg.error = red + +[fonts] +_monospace = Terminus, Monospace, "DejaVu Sans Mono", Monaco, "Bitstream Vera Sans Mono", "Andale Mono", "Liberation Mono", "Courier New", Courier, monospace, Fixed, Consolas, Terminal +completion = 8pt ${_monospace} +tabbar = 8pt ${_monospace} +statusbar = 8pt ${_monospace} +downloads = 8pt ${_monospace} +hints = bold 12px Monospace +debug-console = 8pt ${_monospace} +web-family-standard = +web-family-fixed = +web-family-serif = +web-family-sans-serif = +web-family-cursive = +web-family-fantasy = +web-size-minimum = +web-size-minimum-logical = +web-size-default = +web-size-default-fixed = diff --git a/tests/unit/config/old_configs/qutebrowser-v0.2.0.conf b/tests/unit/config/old_configs/qutebrowser-v0.2.0.conf new file mode 100644 index 000000000..c8a22e017 --- /dev/null +++ b/tests/unit/config/old_configs/qutebrowser-v0.2.0.conf @@ -0,0 +1,200 @@ + + +[general] +ignore-case = smart +wrap-search = true +startpage = https://www.duckduckgo.com +default-page = ${startpage} +auto-search = naive +auto-save-config = true +auto-save-interval = 15000 +editor = gvim -f "{}" +editor-encoding = utf-8 +private-browsing = false +developer-extras = false +print-element-backgrounds = true +xss-auditing = false +site-specific-quirks = true +default-encoding = +new-instance-open-target = window +log-javascript-console = false +save-session = false +session-default-name = + +[ui] +zoom-levels = 25%,33%,50%,67%,75%,90%,100%,110%,125%,150%,175%,200%,250%,300%,400%,500% +default-zoom = 100% +downloads-position = north +message-timeout = 2000 +message-unfocused = false +confirm-quit = never +display-statusbar-messages = false +zoom-text-only = false +frame-flattening = false +user-stylesheet = ::-webkit-scrollbar { width: 0px; height: 0px; } +css-media-type = +remove-finished-downloads = false +hide-statusbar = false +window-title-format = {perc}{title}{title_sep}qutebrowser +hide-mouse-cursor = false + +[network] +do-not-track = true +accept-language = en-US,en +user-agent = +proxy = system +proxy-dns-requests = true +ssl-strict = ask +dns-prefetch = true + +[completion] +download-path-suggestion = path +timestamp-format = %Y-%m-%d +show = true +height = 50% +cmd-history-max-items = 100 +web-history-max-items = 1000 +quick-complete = true +shrink = false + +[input] +timeout = 500 +partial-timeout = 1000 +insert-mode-on-plugins = false +auto-leave-insert-mode = true +auto-insert-mode = false +forward-unbound-keys = auto +spatial-navigation = false +links-included-in-focus-chain = true +rocker-gestures = false +mouse-zoom-divider = 512 + +[tabs] +background-tabs = false +select-on-remove = right +new-tab-position = right +new-tab-position-explicit = last +last-close = ignore +hide-auto = false +hide-always = false +wrap = true +movable = true +close-mouse-button = middle +position = north +show-favicons = true +width = 20% +indicator-width = 3 +indicator-space = 3 +tabs-are-windows = false +title-format = {index}: {title} + +[storage] +download-directory = +maximum-pages-in-cache = +object-cache-capacities = +offline-storage-default-quota = +offline-web-application-cache-quota = +offline-storage-database = true +offline-web-application-storage = true +local-storage = true +cache-size = 52428800 + +[content] +allow-images = true +allow-javascript = true +allow-plugins = false +geolocation = ask +notifications = ask +javascript-can-open-windows = false +javascript-can-close-windows = false +javascript-can-access-clipboard = false +ignore-javascript-prompt = false +ignore-javascript-alert = false +local-content-can-access-remote-urls = false +local-content-can-access-file-urls = true +cookies-accept = default +cookies-store = true +host-block-lists = http://www.malwaredomainlist.com/hostslist/hosts.txt,http://someonewhocares.org/hosts/hosts,http://winhelp2002.mvps.org/hosts.zip,http://malwaredomains.lehigh.edu/files/justdomains.zip,http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext +host-blocking-enabled = true + +[hints] +border = 1px solid #E3BE23 +opacity = 0.7 +mode = letter +chars = asdfghjkl +min-chars = 1 +scatter = true +uppercase = false +auto-follow = true +next-regexes = \bnext\b,\bmore\b,\bnewer\b,\b[>→≫]\b,\b(>>|»)\b +prev-regexes = \bprev(ious)?\b,\bback\b,\bolder\b,\b[<←≪]\b,\b(<<|«)\b + +[searchengines] +DEFAULT = https://duckduckgo.com/?q={} + +[aliases] + +[colors] +completion.fg = white +completion.bg = #333333 +completion.alternate-bg = #444444 +completion.category.fg = white +completion.category.bg = qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #888888, stop:1 #505050) +completion.category.border.top = black +completion.category.border.bottom = ${completion.category.border.top} +completion.item.selected.fg = black +completion.item.selected.bg = #e8c000 +completion.item.selected.border.top = #bbbb00 +completion.item.selected.border.bottom = ${completion.item.selected.border.top} +completion.match.fg = #ff4444 +statusbar.bg = black +statusbar.fg = white +statusbar.bg.error = red +statusbar.bg.warning = darkorange +statusbar.bg.prompt = darkblue +statusbar.bg.insert = darkgreen +statusbar.progress.bg = white +statusbar.url.fg = ${statusbar.fg} +statusbar.url.fg.success = lime +statusbar.url.fg.error = orange +statusbar.url.fg.warn = yellow +statusbar.url.fg.hover = aqua +tabs.fg.odd = white +tabs.fg.even = white +tabs.fg.selected = white +tabs.bg.odd = grey +tabs.bg.even = darkgrey +tabs.bg.selected = black +tabs.bg.bar = #555555 +tabs.indicator.start = #0000aa +tabs.indicator.stop = #00aa00 +tabs.indicator.error = #ff0000 +tabs.indicator.system = rgb +hints.fg = black +hints.fg.match = green +hints.bg = -webkit-gradient(linear, left top, left bottom, color-stop(0%,#FFF785), color-stop(100%,#FFC542)) +downloads.fg = #ffffff +downloads.bg.bar = black +downloads.bg.start = #0000aa +downloads.bg.stop = #00aa00 +downloads.bg.system = rgb +downloads.bg.error = red + +[fonts] +_monospace = Terminus, Monospace, "DejaVu Sans Mono", Monaco, "Bitstream Vera Sans Mono", "Andale Mono", "Liberation Mono", "Courier New", Courier, monospace, Fixed, Consolas, Terminal +completion = 8pt ${_monospace} +tabbar = 8pt ${_monospace} +statusbar = 8pt ${_monospace} +downloads = 8pt ${_monospace} +hints = bold 12px Monospace +debug-console = 8pt ${_monospace} +web-family-standard = +web-family-fixed = +web-family-serif = +web-family-sans-serif = +web-family-cursive = +web-family-fantasy = +web-size-minimum = +web-size-minimum-logical = +web-size-default = +web-size-default-fixed = diff --git a/tests/unit/config/old_configs/qutebrowser-v0.3.0.conf b/tests/unit/config/old_configs/qutebrowser-v0.3.0.conf new file mode 100644 index 000000000..1869edacf --- /dev/null +++ b/tests/unit/config/old_configs/qutebrowser-v0.3.0.conf @@ -0,0 +1,221 @@ + + +[general] +ignore-case = smart +wrap-search = true +startpage = https://www.duckduckgo.com +default-page = ${startpage} +auto-search = naive +auto-save-config = true +auto-save-interval = 15000 +editor = gvim -f "{}" +editor-encoding = utf-8 +private-browsing = false +developer-extras = false +print-element-backgrounds = true +xss-auditing = false +site-specific-quirks = true +default-encoding = +new-instance-open-target = tab +log-javascript-console = false +save-session = false +session-default-name = + +[ui] +zoom-levels = 25%,33%,50%,67%,75%,90%,100%,110%,125%,150%,175%,200%,250%,300%,400%,500% +default-zoom = 100% +downloads-position = north +message-timeout = 2000 +message-unfocused = false +confirm-quit = never +display-statusbar-messages = false +zoom-text-only = false +frame-flattening = false +user-stylesheet = ::-webkit-scrollbar { width: 0px; height: 0px; } +css-media-type = +smooth-scrolling = false +remove-finished-downloads = false +hide-statusbar = false +window-title-format = {perc}{title}{title_sep}qutebrowser +hide-mouse-cursor = false +modal-js-dialog = false + +[network] +do-not-track = true +accept-language = en-US,en +user-agent = +proxy = system +proxy-dns-requests = true +ssl-strict = ask +dns-prefetch = true + +[completion] +auto-open = true +download-path-suggestion = path +timestamp-format = %Y-%m-%d +show = true +height = 50% +cmd-history-max-items = 100 +web-history-max-items = 1000 +quick-complete = true +shrink = false + +[input] +timeout = 500 +partial-timeout = 1000 +insert-mode-on-plugins = false +auto-leave-insert-mode = true +auto-insert-mode = false +forward-unbound-keys = auto +spatial-navigation = false +links-included-in-focus-chain = true +rocker-gestures = false +mouse-zoom-divider = 512 + +[tabs] +background-tabs = false +select-on-remove = right +new-tab-position = right +new-tab-position-explicit = last +last-close = ignore +hide-auto = false +hide-always = false +wrap = true +movable = true +close-mouse-button = middle +position = north +show-favicons = true +width = 20% +indicator-width = 3 +indicator-space = 3 +tabs-are-windows = false +title-format = {index}: {title} +mousewheel-tab-switching = true + +[storage] +download-directory = +maximum-pages-in-cache = +object-cache-capacities = +offline-storage-default-quota = +offline-web-application-cache-quota = +offline-storage-database = true +offline-web-application-storage = true +local-storage = true +cache-size = 52428800 + +[content] +allow-images = true +allow-javascript = true +allow-plugins = false +webgl = true +css-regions = true +hyperlink-auditing = false +geolocation = ask +notifications = ask +javascript-can-open-windows = false +javascript-can-close-windows = false +javascript-can-access-clipboard = false +ignore-javascript-prompt = false +ignore-javascript-alert = false +local-content-can-access-remote-urls = false +local-content-can-access-file-urls = true +cookies-accept = no-3rdparty +cookies-store = true +host-block-lists = http://www.malwaredomainlist.com/hostslist/hosts.txt,http://someonewhocares.org/hosts/hosts,http://winhelp2002.mvps.org/hosts.zip,http://malwaredomains.lehigh.edu/files/justdomains.zip,http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext +host-blocking-enabled = true + +[hints] +border = 1px solid #E3BE23 +opacity = 0.7 +mode = letter +chars = asdfghjkl +min-chars = 1 +scatter = true +uppercase = false +auto-follow = true +next-regexes = \bnext\b,\bmore\b,\bnewer\b,\b[>→≫]\b,\b(>>|»)\b,\bcontinue\b +prev-regexes = \bprev(ious)?\b,\bback\b,\bolder\b,\b[<←≪]\b,\b(<<|«)\b + +[searchengines] +DEFAULT = https://duckduckgo.com/?q={} + +[aliases] + +[colors] +completion.fg = white +completion.bg = #333333 +completion.alternate-bg = #444444 +completion.category.fg = white +completion.category.bg = qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #888888, stop:1 #505050) +completion.category.border.top = black +completion.category.border.bottom = ${completion.category.border.top} +completion.item.selected.fg = black +completion.item.selected.bg = #e8c000 +completion.item.selected.border.top = #bbbb00 +completion.item.selected.border.bottom = ${completion.item.selected.border.top} +completion.match.fg = #ff4444 +statusbar.fg = white +statusbar.bg = black +statusbar.fg.error = ${statusbar.fg} +statusbar.bg.error = red +statusbar.fg.warning = ${statusbar.fg} +statusbar.bg.warning = darkorange +statusbar.fg.prompt = ${statusbar.fg} +statusbar.bg.prompt = darkblue +statusbar.fg.insert = ${statusbar.fg} +statusbar.bg.insert = darkgreen +statusbar.fg.command = ${statusbar.fg} +statusbar.bg.command = ${statusbar.bg} +statusbar.fg.caret = ${statusbar.fg} +statusbar.bg.caret = purple +statusbar.fg.caret-selection = ${statusbar.fg} +statusbar.bg.caret-selection = #a12dff +statusbar.progress.bg = white +statusbar.url.fg = ${statusbar.fg} +statusbar.url.fg.success = lime +statusbar.url.fg.error = orange +statusbar.url.fg.warn = yellow +statusbar.url.fg.hover = aqua +tabs.fg.odd = white +tabs.bg.odd = grey +tabs.fg.even = white +tabs.bg.even = darkgrey +tabs.fg.selected = white +tabs.bg.selected = black +tabs.bg.bar = #555555 +tabs.indicator.start = #0000aa +tabs.indicator.stop = #00aa00 +tabs.indicator.error = #ff0000 +tabs.indicator.system = rgb +hints.fg = black +hints.bg = -webkit-gradient(linear, left top, left bottom, color-stop(0%,#FFF785), color-stop(100%,#FFC542)) +hints.fg.match = green +downloads.bg.bar = black +downloads.fg.start = white +downloads.bg.start = #0000aa +downloads.fg.stop = ${downloads.fg.start} +downloads.bg.stop = #00aa00 +downloads.fg.system = rgb +downloads.bg.system = rgb +downloads.fg.error = white +downloads.bg.error = red +webpage.bg = white + +[fonts] +_monospace = Terminus, Monospace, "DejaVu Sans Mono", Monaco, "Bitstream Vera Sans Mono", "Andale Mono", "Liberation Mono", "Courier New", Courier, monospace, Fixed, Consolas, Terminal +completion = 8pt ${_monospace} +tabbar = 8pt ${_monospace} +statusbar = 8pt ${_monospace} +downloads = 8pt ${_monospace} +hints = bold 12px Monospace +debug-console = 8pt ${_monospace} +web-family-standard = +web-family-fixed = +web-family-serif = +web-family-sans-serif = +web-family-cursive = +web-family-fantasy = +web-size-minimum = +web-size-minimum-logical = +web-size-default = +web-size-default-fixed = diff --git a/tests/unit/config/old_configs/qutebrowser-v0.4.0.conf b/tests/unit/config/old_configs/qutebrowser-v0.4.0.conf new file mode 100644 index 000000000..7551c9f77 --- /dev/null +++ b/tests/unit/config/old_configs/qutebrowser-v0.4.0.conf @@ -0,0 +1,226 @@ + + +[general] +ignore-case = smart +wrap-search = true +startpage = https://www.duckduckgo.com +default-page = ${startpage} +auto-search = naive +auto-save-config = true +auto-save-interval = 15000 +editor = gvim -f "{}" +editor-encoding = utf-8 +private-browsing = false +developer-extras = false +print-element-backgrounds = true +xss-auditing = false +site-specific-quirks = true +default-encoding = +new-instance-open-target = tab +log-javascript-console = false +save-session = false +session-default-name = + +[ui] +zoom-levels = 25%,33%,50%,67%,75%,90%,100%,110%,125%,150%,175%,200%,250%,300%,400%,500% +default-zoom = 100% +downloads-position = top +message-timeout = 2000 +message-unfocused = false +confirm-quit = never +display-statusbar-messages = false +zoom-text-only = false +frame-flattening = false +user-stylesheet = ::-webkit-scrollbar { width: 0px; height: 0px; } +css-media-type = +smooth-scrolling = false +remove-finished-downloads = false +hide-statusbar = false +statusbar-padding = 1,1,0,0 +window-title-format = {perc}{title}{title_sep}qutebrowser +hide-mouse-cursor = false +modal-js-dialog = false + +[network] +do-not-track = true +accept-language = en-US,en +referer-header = same-domain +user-agent = +proxy = system +proxy-dns-requests = true +ssl-strict = ask +dns-prefetch = true + +[completion] +auto-open = true +download-path-suggestion = path +timestamp-format = %Y-%m-%d +show = true +height = 50% +cmd-history-max-items = 100 +web-history-max-items = 1000 +quick-complete = true +shrink = false + +[input] +timeout = 500 +partial-timeout = 1000 +insert-mode-on-plugins = false +auto-leave-insert-mode = true +auto-insert-mode = false +forward-unbound-keys = auto +spatial-navigation = false +links-included-in-focus-chain = true +rocker-gestures = false +mouse-zoom-divider = 512 + +[tabs] +background-tabs = false +select-on-remove = right +new-tab-position = right +new-tab-position-explicit = last +last-close = ignore +show = always +show-switching-delay = 800 +wrap = true +movable = true +close-mouse-button = middle +position = top +show-favicons = true +width = 20% +indicator-width = 3 +tabs-are-windows = false +title-format = {index}: {title} +mousewheel-tab-switching = true +padding = 0,0,5,5 +indicator-padding = 2,2,0,4 + +[storage] +download-directory = +prompt-download-directory = true +remember-download-directory = true +maximum-pages-in-cache = +object-cache-capacities = +offline-storage-default-quota = +offline-web-application-cache-quota = +offline-storage-database = true +offline-web-application-storage = true +local-storage = true +cache-size = 52428800 + +[content] +allow-images = true +allow-javascript = true +allow-plugins = false +webgl = true +css-regions = true +hyperlink-auditing = false +geolocation = ask +notifications = ask +javascript-can-open-windows = false +javascript-can-close-windows = false +javascript-can-access-clipboard = false +ignore-javascript-prompt = false +ignore-javascript-alert = false +local-content-can-access-remote-urls = false +local-content-can-access-file-urls = true +cookies-accept = no-3rdparty +cookies-store = true +host-block-lists = http://www.malwaredomainlist.com/hostslist/hosts.txt,http://someonewhocares.org/hosts/hosts,http://winhelp2002.mvps.org/hosts.zip,http://malwaredomains.lehigh.edu/files/justdomains.zip,http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext +host-blocking-enabled = true + +[hints] +border = 1px solid #E3BE23 +opacity = 0.7 +mode = letter +chars = asdfghjkl +min-chars = 1 +scatter = true +uppercase = false +auto-follow = true +next-regexes = \bnext\b,\bmore\b,\bnewer\b,\b[>→≫]\b,\b(>>|»)\b,\bcontinue\b +prev-regexes = \bprev(ious)?\b,\bback\b,\bolder\b,\b[<←≪]\b,\b(<<|«)\b + +[searchengines] +DEFAULT = https://duckduckgo.com/?q={} + +[aliases] + +[colors] +completion.fg = white +completion.bg = #333333 +completion.alternate-bg = #444444 +completion.category.fg = white +completion.category.bg = qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #888888, stop:1 #505050) +completion.category.border.top = black +completion.category.border.bottom = ${completion.category.border.top} +completion.item.selected.fg = black +completion.item.selected.bg = #e8c000 +completion.item.selected.border.top = #bbbb00 +completion.item.selected.border.bottom = ${completion.item.selected.border.top} +completion.match.fg = #ff4444 +statusbar.fg = white +statusbar.bg = black +statusbar.fg.error = ${statusbar.fg} +statusbar.bg.error = red +statusbar.fg.warning = ${statusbar.fg} +statusbar.bg.warning = darkorange +statusbar.fg.prompt = ${statusbar.fg} +statusbar.bg.prompt = darkblue +statusbar.fg.insert = ${statusbar.fg} +statusbar.bg.insert = darkgreen +statusbar.fg.command = ${statusbar.fg} +statusbar.bg.command = ${statusbar.bg} +statusbar.fg.caret = ${statusbar.fg} +statusbar.bg.caret = purple +statusbar.fg.caret-selection = ${statusbar.fg} +statusbar.bg.caret-selection = #a12dff +statusbar.progress.bg = white +statusbar.url.fg = ${statusbar.fg} +statusbar.url.fg.success = lime +statusbar.url.fg.error = orange +statusbar.url.fg.warn = yellow +statusbar.url.fg.hover = aqua +tabs.fg.odd = white +tabs.bg.odd = grey +tabs.fg.even = white +tabs.bg.even = darkgrey +tabs.fg.selected = white +tabs.bg.selected = black +tabs.bg.bar = #555555 +tabs.indicator.start = #0000aa +tabs.indicator.stop = #00aa00 +tabs.indicator.error = #ff0000 +tabs.indicator.system = rgb +hints.fg = black +hints.bg = -webkit-gradient(linear, left top, left bottom, color-stop(0%,#FFF785), color-stop(100%,#FFC542)) +hints.fg.match = green +downloads.bg.bar = black +downloads.fg.start = white +downloads.bg.start = #0000aa +downloads.fg.stop = ${downloads.fg.start} +downloads.bg.stop = #00aa00 +downloads.fg.system = rgb +downloads.bg.system = rgb +downloads.fg.error = white +downloads.bg.error = red +webpage.bg = white + +[fonts] +_monospace = Terminus, Monospace, "DejaVu Sans Mono", Monaco, "Bitstream Vera Sans Mono", "Andale Mono", "Liberation Mono", "Courier New", Courier, monospace, Fixed, Consolas, Terminal +completion = 8pt ${_monospace} +tabbar = 8pt ${_monospace} +statusbar = 8pt ${_monospace} +downloads = 8pt ${_monospace} +hints = bold 13px Monospace +debug-console = 8pt ${_monospace} +web-family-standard = +web-family-fixed = +web-family-serif = +web-family-sans-serif = +web-family-cursive = +web-family-fantasy = +web-size-minimum = +web-size-minimum-logical = +web-size-default = +web-size-default-fixed = diff --git a/tests/unit/config/test_config.py b/tests/unit/config/test_config.py index 8b54988d7..2afc56d22 100644 --- a/tests/unit/config/test_config.py +++ b/tests/unit/config/test_config.py @@ -24,12 +24,14 @@ import configparser import types import argparse import collections +import shutil from unittest import mock from PyQt5.QtCore import QObject from PyQt5.QtGui import QColor import pytest +import qutebrowser from qutebrowser.config import config, configexc, configdata from qutebrowser.config.parsers import keyconf from qutebrowser.commands import runners @@ -286,6 +288,30 @@ class TestDefaultConfig: for cmd in conf.get_bindings_for(sectname).values(): runner.parse(cmd, aliases=False) + def test_upgrade_version(self): + """Fail when the qutebrowser version changed. + + The aim of this is to remind us to add a new file to old_configs. + + If the config file of the current release didn't change compared to the + last one in old_configs, just increment the version here. + + If it did change, place a new qutebrowser-vx.y.z.conf in old_configs + and then increment the version. + """ + assert qutebrowser.__version__ == '0.4.1' + + @pytest.mark.parametrize('filename', + os.listdir(os.path.join(os.path.dirname(__file__), 'old_configs')), + ids=os.path.basename) + def test_old_config(self, tmpdir, filename): + """Check if upgrading old configs works correctly.""" + full_path = os.path.join(os.path.dirname(__file__), 'old_configs', + filename) + shutil.copy(full_path, str(tmpdir / 'qutebrowser.conf')) + conf = config.ConfigManager() + conf.read(str(tmpdir), 'qutebrowser.conf') + @pytest.mark.integration class TestConfigInit: