qutebrowser/tests/unit
Jimmy 5252541fe3 greasemonkey: better handle scripts without metadata
Previously calling `script.code()` would fail if the script didn't have
a `name`. This wasn't being hit in practice because the only place that
constructs GreasemonkeyScripts was checking for that condition and add
the filename there as a fallback.

This change make the `name` attribute more explicitly mandatory by
failing with a `ValueError` if it is not provided and make it still
possible to use the filename fallback in that case by adding a
`filename` keyward argument to `__init__()`.

Additionally where `script_meta` is used in `script.code()` a fallback
to and emptry string was added so it doesn't fail for raw javascript
files without greasemonkey metadata.
2018-09-09 20:51:19 +12:00
..
browser Use a shared web_history fixture 2018-09-06 20:08:32 +02:00
commands Wait until runner is finished in test_custom_env 2018-03-19 11:43:08 +01:00
completion Use a shared web_history fixture 2018-09-06 20:08:32 +02:00
config Fix pylint issues with config cache 2018-09-06 16:43:10 +02:00
javascript greasemonkey: better handle scripts without metadata 2018-09-09 20:51:19 +12:00
keyinput Recognize "Command"/"Cmd" in keybindings 2018-08-28 18:57:47 +02:00
mainwindow Use config_stub.val instead of config_stub.set_obj in tests 2018-09-02 14:42:47 +02:00
misc Define names for sqlite error codes 2018-09-01 22:25:22 +02:00
scripts Update copyright years 2018-02-05 12:19:50 +01:00
utils Handle :// as URL pattern 2018-09-02 11:58:34 +02:00
test_app.py Update copyright years 2018-02-05 12:19:50 +01:00