Commit Graph
81 Commits
Author SHA1 Message Date
Nicola Soranzo 8cdca0f343 Revert some requests import changes
introduced in https://github.com/galaxyproject/galaxy/pull/18003 .
In particular, when using requests in the tests to connect to Galaxy
or the ToolShed it's not needed to use the modified headers.

Also:
- Move some imports after conditional imports.
- Fix type annotations in `lib/tool_shed/test/base/populators.py`
- Fix typo bug in `test/unit/util/test_get_url.py`
2024-05-23 15:55:56 +01:00
John Chilton f95da89b3d Implement file source templates 2024-05-20 12:18:47 -04:00
John Chilton 2f43c32fd9 Merge pull request #18003 from mvdbeek/add_galaxy_to_user_agent
Add galaxy to user agent
2024-05-20 12:14:13 -04:00
Nicola Soranzo 0629908541 Fix new UP031 errors from ruff 0.4.2 2024-04-29 00:09:38 +01:00
mvdbeek e8a3b8c0cd Create wrapper for requests with default user agent 2024-04-16 17:54:29 +02:00
Nicola Soranzo dcb6f061f6 Don't install Galaxy packages in editable mode when testing them
When enabling the `warn_unused_ignores = True` option of mypy, this
was making the `test_galaxy_packages` tests fail with:

```
mypy .
Traceback (most recent call last):
  File "/tmp/gxpkgtestenvu3fgDr/bin/mypy", line 8, in <module>
    sys.exit(console_entry())
  File "/tmp/gxpkgtestenvu3fgDr/lib/python3.10/site-packages/mypy/__main__.py", line 15, in console_entry
    main()
  File "mypy/main.py", line 100, in main
  File "mypy/main.py", line 182, in run_build
  File "mypy/build.py", line 192, in build
  File "mypy/build.py", line 266, in _build
  File "mypy/build.py", line 2942, in dispatch
  File "mypy/build.py", line 3333, in process_graph
  File "mypy/build.py", line 3414, in process_fresh_modules
  File "mypy/build.py", line 2110, in fix_cross_refs
  File "mypy/fixup.py", line 52, in fixup_module
  File "mypy/fixup.py", line 127, in visit_symbol_table
  File "mypy/lookup.py", line 49, in lookup_fully_qualified
AssertionError: Cannot find component 'util' for 'galaxy.util'
make: *** [Makefile:96: mypy] Error 1
```

Moreover, installing packages in editable mode was hiding some issues
with how files from other packages were accessed.
2024-04-16 01:12:57 +01:00
Nicola Soranzo e975ca3754 Update to black 2024 stable style 2024-01-30 18:09:51 +00:00
Nicola Soranzo 9978004f34 Fix tests after Python 3.12 changes for comprehensions 2024-01-21 20:46:09 +00:00
Nicola Soranzo ab99721900 Merge branch 'release_23.0' into dev 2023-05-14 14:40:28 +01:00
mvdbeek 69ebbb761a Replace httpbin service with pytest-httpserver
httpbin isn't doing too well, this should be more robust.
2023-05-04 19:48:54 +02:00
mvdbeek d2271e5e04 Replace httpbin service with pytest-httpserver
httpbin isn't doing too well, this should be more robust.
2023-05-04 17:38:19 +02:00
John Davis dacc38698b Add utility function for enum member values + test 2023-04-13 18:53:44 -04:00
Nicola Soranzo 64af46c4ae Fix new B018 errors raised by ruff 0.0.260 2023-04-13 16:53:01 +01:00
mvdbeek c431c6f0fc Tighten pytest raises assertions 2023-01-21 12:54:05 +01:00
Nicola Soranzo c5868cc717 Add overloads to `listify()` type annotations
Also:
- Add unit tests.
2022-11-28 04:50:03 +00:00
John Davis 3b488017b1 Normalize path before checking basename 2022-11-21 18:12:04 -05:00
John Davis b2d6b8d40d Skip dbscript tests if running from packages; refactor util function 2022-11-21 18:12:04 -05:00
John Davis 86cc0f2b69 Move custom templates into the config package 2022-11-21 18:12:04 -05:00
Nicola Soranzo 2b362fbd1d Merge branch 'release_22.05' into dev 2022-11-17 22:50:45 +00:00
Nicola Soranzo 988f4e583c Merge branch 'release_22.01' into release_22.05 2022-11-17 22:48:35 +00:00
Nicola Soranzo c80577e0b3 Fix setting `LC_CTYPE` variable in clean environment on macOS
Fix some older tools (not using `profile` or `stdio`) failing because
of the following warning printed on stderr when run locally on macOS:

```
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LC_ALL = (unset),
LC_CTYPE = "C.UTF-8",
LANG = (unset)
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
```
2022-11-17 10:50:07 +00:00
mvdbeek 304b12c143 Move things around 2022-11-16 17:01:28 +01:00
mvdbeek 69673a354b Skip test if httpbin down 2022-11-16 15:24:40 +01:00
Cameron Hyde c00d6d1de0 Fix linting 2022-11-10 19:10:20 +11:00
Cameron Hyde fc9f3c3974 Remove import from manager and hard-code TEMPLATE_RELPATH 2022-11-01 15:13:54 +10:00
Cameron Hyde f1f9f6c87f Formatting 2022-11-01 12:25:48 +10:00
Cameron Hyde 48e1f055ba Assert default template render against DOCTYPE tag 2022-11-01 12:23:29 +10:00
Cameron Hyde ab6b126fa1 Assert custom template test against entire expected content 2022-11-01 12:19:48 +10:00
Cameron Hyde 5f9c2300e3 Set template relpaths as variables in managers/users.py 2022-11-01 12:16:51 +10:00
Cameron Hyde dbc9cfbe9b Remove redundant template context 2022-11-01 12:13:23 +10:00
Cameron Hyde 3210a1961d Refactor tests to use template activation-email.txt from codebase 2022-11-01 09:49:26 +10:00
Cameron Hyde 296b1081f8 Formatting 2022-10-31 14:57:59 +10:00
Cameron Hyde 80d92a1eab Add tests for custom template rendering 2022-10-31 13:59:09 +10:00
John Davis 66ceff374a Ignore type error in test: wrong value is intentional 2022-10-13 13:42:00 -04:00
John Davis 4818c8dadf Add get_from_env utility + tests 2022-10-13 13:17:15 -04:00
Nicola Soranzo c35d8f2a06 Replace `unittest.TestCase` with pytest-based partial re-implementation
Also:
- Rename `FooBarTestCase` test classes as `TestFooBar`. These were collected
  by pytest only because they were `unittest.TestCase` derived, but normally
  pytest collects only test classes whose name starts with `Test`, see
  https://docs.pytest.org/en/7.1.x/reference/reference.html#confval-python_classes
2022-09-27 03:34:58 +01:00
John ChiltonandNicola Soranzo 2026d079b5 Update test/unit/util/test_properties.py
Co-authored-by: Nicola Soranzo <nicola.soranzo@gmail.com>
2022-08-25 12:26:18 -04:00
John Chilton ff80452421 Strong typing for galaxy.util.properties. 2022-08-24 17:37:08 -04:00
davelopez 4846d04dad Add unit test for quoted strings with spaces 2022-08-05 15:54:04 +02:00
mvdbeek 73c73e0822 Test Decimal/inf/nan value dumping 2022-07-08 19:39:38 +03:00
John Chilton 5cd81741a7 Allow quoting in search library for exact matches (e.g. filtering on specific tags/tools). 2022-04-30 20:10:52 -04:00
John Chilton da8fe33e9a Typing and testing for baseline galaxy.util.search functionality. 2022-04-30 20:10:52 -04:00
Nicola Soranzo 2f0f4c7e08 Replace 2 uses of deprecated `imp` module
Also:
- Move doctests for `in_directory()` function to unit tests, add test
  for `local_path_module` parameter to exercise the posixpath/ntpath
  import code.
2022-04-21 19:53:35 +01:00
mvdbeek b39e8ad9a2 First pass in dropping uwsgi specific things 2022-03-15 21:31:59 +01:00
Dannon Baker 623a5e165a Apply black formatting.
Apply isort.
2022-02-03 07:42:20 -05:00
Nicola Soranzo b9b0046621 Remove unnecessary checks for Python version 2021-11-26 15:30:09 +00:00
mvdbeek 8f300a5289 Move doctest to unittest 2021-11-19 13:20:06 +01:00
John Chilton 32cf97d78a Type fixes for lazy_process.py 2021-10-14 00:51:10 -04:00
John Chilton 54e8d22fa7 Check types of modules without type annotations in the their signatures on new modules.
https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-check-untyped-defs

> it type checks the body of every function, regardless of whether it has type annotations. (By default the bodies of functions without annotations are not type checked.)
2021-10-11 16:08:26 -04:00
John Chilton 8f9034a414 Typing fixes for various unit tests. 2021-10-05 13:22:41 -04:00