Commit graph

12 commits

Author SHA1 Message Date
9bad001c04
chore: remove fixture imports in the tests
They ideally should find their way by themselves.

> You don’t need to import the fixture you want to use in a test,
> it automatically gets discovered by pytest. The discovery of fixture
> functions starts at test classes, then test modules, then conftest.py
> files and finally builtin and third party plugins.>
>
> — [pytest docs](https://docs.pytest.org/en/4.6.x/fixture.html#conftest-py-sharing-fixture-functions)
2024-06-05 15:56:09 +02:00
Alexis Métaireau
65a8827daa
chore: minor linting
A few minor changes about when to use `==` and when to use `is`.
Basically, this uses `is` for booleans, and `==` for other values.

With a few other changes about coding style which was enforced by
`ruff`.
2024-06-05 14:19:31 +02:00
Alexis Métaireau
cbbd6afcc1
chore: remove unused code
This commit removes code that's not being used, it can be exceptions
with the `as e` where the exception itself is not used, the same with
`with` statements, and some other parts where there were duplicated
code.
2024-06-05 14:19:31 +02:00
Alexis Métaireau
5aa4863b52
chore(imports): remove useless imports
As detected by [ruff](https://github.com/astral-sh/ruff)

Related to #254, although it doesn't provide the command to lint the
codebase itself.
2024-06-05 14:19:30 +02:00
Alex Pyrgiotis
ba5adb33c0
Fix a bug in "Change Selection"
Fix a bug in the "Change Selection" action, whereby changing your
selection and picking files from another directory results in:

    "Dangerzone does not support adding documents from multiple
    locations. The newly added documents were ignored."

To fix this, change the output directory when we change selection as
well.
2023-10-13 22:45:11 +03:00
Alex Pyrgiotis
81811e0aac
Add collapsible dialog for errors
Move the error message from a text browser to a collapsible widget.
2023-08-01 14:29:27 +03:00
deeplow
53ec1cad63
Add update error red dot to hamburger menu 2023-08-01 14:29:11 +03:00
Alex Pyrgiotis
bc4bba4fa1
tests: Add full test coverage for updater checks
Fully test the update check logic, by introducing several Qt tests.
Also, improve the `UpdaterThread.get_letest_info()` method, that gets
the latest version and changelog from GitHub, with several checks.
These checks are also tested in our newly added tests.
2023-07-28 12:18:59 +03:00
deeplow
8254844724
Pass sample_pdf as fixture instead of via class
Now that sample_doc was renamed to sample_pdf it could cause some
confusion the fact that that the TestBase class had an attribute called
sample_doc which referenced  the sample PDF.

By removing this attribute and passing the fixture instead we are
following a more pytest-native approach of passing arguments explicitly.
2023-07-25 15:00:32 +01:00
deeplow
6216761058
remove number from test_doc2 variable
create a pytest fixture for a .doc file and .pdf file
2023-07-25 15:00:31 +01:00
deeplow
9ca27fd6fe
Add unit test to document change button
Fixes #428
2023-07-25 15:00:29 +01:00
Alex Pyrgiotis
47b337143c
tests: Add Qt test for updates
Add a very rudimentary test for GUI update logic.

Refs #290
2023-07-24 16:54:16 +03:00