| 1 |
# Copyright (c) Alexei Znamensky ([email protected]) |
| 2 |
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) |
| 3 |
# SPDX-License-Identifier: GPL-3.0-or-later |
| 4 |
|
| 5 |
--- |
| 6 |
anchors: |
| 7 |
environ: &env-def {environ_update: {LANGUAGE: C, LC_ALL: C}, check_rc: true} |
| 8 |
test_cases: |
| 9 |
- id: test_set_handler |
| 10 |
input: |
| 11 |
handler: google-chrome.desktop |
| 12 |
mime_type: x-scheme-handler/http |
| 13 |
output: |
| 14 |
handler: google-chrome.desktop |
| 15 |
changed: true |
| 16 |
mocks: |
| 17 |
run_command: |
| 18 |
- command: [/testbin/gio, --version] |
| 19 |
environ: *env-def |
| 20 |
rc: 0 |
| 21 |
out: "2.80.0\n" |
| 22 |
err: '' |
| 23 |
- command: [/testbin/gio, mime, x-scheme-handler/http] |
| 24 |
environ: *env-def |
| 25 |
rc: 0 |
| 26 |
out: '' |
| 27 |
err: > |
| 28 |
No default applications for “x-scheme-handler/http” |
| 29 |
- command: [/testbin/gio, mime, x-scheme-handler/http, google-chrome.desktop] |
| 30 |
environ: *env-def |
| 31 |
rc: 0 |
| 32 |
out: "Set google-chrome.desktop as the default for x-scheme-handler/http\n" |
| 33 |
err: '' |
| 34 |
- id: test_set_handler_check |
| 35 |
input: |
| 36 |
handler: google-chrome.desktop |
| 37 |
mime_type: x-scheme-handler/http |
| 38 |
output: |
| 39 |
handler: google-chrome.desktop |
| 40 |
changed: true |
| 41 |
stdout: Module executed in check mode |
| 42 |
diff: |
| 43 |
before: |
| 44 |
handler: null |
| 45 |
after: |
| 46 |
handler: google-chrome.desktop |
| 47 |
flags: |
| 48 |
check: true |
| 49 |
diff: true |
| 50 |
mocks: |
| 51 |
run_command: |
| 52 |
- command: [/testbin/gio, --version] |
| 53 |
environ: *env-def |
| 54 |
rc: 0 |
| 55 |
out: "2.80.0\n" |
| 56 |
err: '' |
| 57 |
- command: [/testbin/gio, mime, x-scheme-handler/http] |
| 58 |
environ: *env-def |
| 59 |
rc: 0 |
| 60 |
out: '' |
| 61 |
err: > |
| 62 |
No default applications for “x-scheme-handler/http” |
| 63 |
- id: test_set_handler_idempot |
| 64 |
input: |
| 65 |
handler: google-chrome.desktop |
| 66 |
mime_type: x-scheme-handler/http |
| 67 |
output: |
| 68 |
handler: google-chrome.desktop |
| 69 |
changed: false |
| 70 |
mocks: |
| 71 |
run_command: |
| 72 |
- command: [/testbin/gio, --version] |
| 73 |
environ: *env-def |
| 74 |
rc: 0 |
| 75 |
out: "2.80.0\n" |
| 76 |
err: '' |
| 77 |
- command: [/testbin/gio, mime, x-scheme-handler/http] |
| 78 |
environ: *env-def |
| 79 |
rc: 0 |
| 80 |
out: | |
| 81 |
Default application for “x-scheme-handler/https”: google-chrome.desktop |
| 82 |
Registered applications: |
| 83 |
brave-browser.desktop |
| 84 |
firefox.desktop |
| 85 |
google-chrome.desktop |
| 86 |
firefox_firefox.desktop |
| 87 |
Recommended applications: |
| 88 |
brave-browser.desktop |
| 89 |
firefox.desktop |
| 90 |
google-chrome.desktop |
| 91 |
firefox_firefox.desktop |
| 92 |
err: '' |
| 93 |
- id: test_set_handler_idempot_check |
| 94 |
input: |
| 95 |
handler: google-chrome.desktop |
| 96 |
mime_type: x-scheme-handler/http |
| 97 |
output: |
| 98 |
handler: google-chrome.desktop |
| 99 |
changed: false |
| 100 |
flags: |
| 101 |
check: true |
| 102 |
mocks: |
| 103 |
run_command: |
| 104 |
- command: [/testbin/gio, --version] |
| 105 |
environ: *env-def |
| 106 |
rc: 0 |
| 107 |
out: "2.80.0\n" |
| 108 |
err: '' |
| 109 |
- command: [/testbin/gio, mime, x-scheme-handler/http] |
| 110 |
environ: *env-def |
| 111 |
rc: 0 |
| 112 |
out: | |
| 113 |
Default application for “x-scheme-handler/https”: google-chrome.desktop |
| 114 |
Registered applications: |
| 115 |
brave-browser.desktop |
| 116 |
firefox.desktop |
| 117 |
google-chrome.desktop |
| 118 |
firefox_firefox.desktop |
| 119 |
Recommended applications: |
| 120 |
brave-browser.desktop |
| 121 |
firefox.desktop |
| 122 |
google-chrome.desktop |
| 123 |
firefox_firefox.desktop |
| 124 |
err: '' |