Граф коммитов

22 Коммитов

Автор SHA1 Сообщение Дата
Yoann Schneider cfb19a5ef8
Bug 1823654 - Mostly use double quotes (#7900)
* Enable quote style verifications from Black

* Actually exclude migrations folders
2024-01-31 16:59:20 +01:00
Armen Zambrano 368c112266
Apply black formating to the whole repo (#6332)
* Automatic black fixes
* Add conflicting rule exceptions between black and flake8
2020-04-21 10:35:59 -04:00
pyup.io bot 2647b998aa Update pytest to 3.8.0 (#3989)
* Update pytest from 3.7.4 to 3.8.0

* Fix django.core.urlresolvers deprecation warnings

The new version of pytest now correctly catches warnings that occur
within tests/fixtures, which has unearthed new Deprecation warnings
that need fixing to prevent test failures.

Prevents:
```
RemovedInDjango20Warning: Importing from django.core.urlresolvers is
deprecated in favor of django.urls.
```
2018-09-06 15:37:17 +01:00
Ed Morley a5023192e9
Bug 1453482 - Use d-r-f's APIClient instead of WebTest's TestApp (#3439)
To avoid unnecessary dependencies, and use a more conventional
django-rest-framework testing approach:
http://www.django-rest-framework.org/api-guide/testing/#apiclient

APIClient has a few API differences:
* `.json` -> `.json()`
* `.status_int` -> `.status_code`
* Get parameters are passed as keyword argument `data` not `params`
* The default hostname is `http://testserver` not `http://localhost`
* Additional HTTP headers are passed directly as keyword arguments,
  rather than nested under a `headers` property.
* It doesn't check the status code itself, so explicit checks are
  required, along with removing `expect_errors`.
* The `.post_json()` and `.put_json()` methods don't exist.

See also the docs for the Django test client (which APIClient wraps):
https://docs.djangoproject.com/en/1.11/topics/testing/tools/#the-test-client

Whilst making these changes, I also cleaned up the session fetching
in `test_auth.py` and `test_backends.py`, and added a `status_code`
check in `conftest.py`'s `mock_post_json()` - which makes the root
cause of test failures clearer.
2018-04-12 18:06:53 +01:00
Alisha Aneja 5cdc2170cc Bug 1223883 - Fix pytest warnings for test collection (#2717)
pytest treats objects starting with the string "Test" as tests, so an
underscore prefix has been added to prevent warnings of form:

```
WC1 .../test_detect_intermittents.py cannot collect test class 'TestFailureDetector' because it has a __init__ constructor
```
2017-08-22 15:10:58 +01:00
William Lachance ae0be9d81c Bug 1329002 - Remove jobs model 2017-01-06 15:01:19 -05:00
William Lachance ecac73e26a Bug 1256485 - Don't load initial data in unit tests
It's almost entirely unnecessary (the few times we need base data
we can generate it ourselves) and can overwrite other test data
if we're not careful. Better just to remove it.
2016-03-16 14:47:39 -04:00
Ed Morley a5999ac2b9 Bug 1197186 - Move wsgi.py to a generic config/ directory
Since it's not specific to the Django app 'webapp'.
2015-10-08 19:59:44 +01:00
Ed Morley 90ba77e596 Bug 1192801 - Remove per-file MPL boilerplate since it's unnecessary
The MPL 2.0 terms state that as long as a LICENSE file is present, the
per-file header text is not required. See "Exhibit A" at the end of:
https://www.mozilla.org/MPL/2.0/
2015-08-18 23:32:11 +01:00
Ed Morley 1c00ccfcc7 Bug 1192661 - Clean up Python import order
Created using |isort -p tests -rc .| and a couple of manual tweaks.

The order is:
* futures
* std library
* third party packages
* local imports
* relative local imports
...with each group ordered with "import x" before "from x import y", and
then alphabetically.
2015-08-10 18:33:49 +01:00
Ed Morley a49c98b180 Bug 1186357 - Remove the deprecated objectstore endpoint
Since bug 1140349, the objectstore endpoint has been deprecated, and
performs the same function as the jobs endpoint. Now that there are no
remaining submitters to it, let's remove it.
2015-07-30 13:19:30 +01:00
Cameron Dawson 00cfe6643d Bug 1140349 - Remove the objectstore code
After the previous commit, the Objectstore is effectively "dead code".
So this commit removes all the dead code after anything left over in
the Objectstore has been drained and added to the DB.
2015-07-21 14:13:21 -07:00
Ed Morley f5c0b53e0c Bug 1059814 - Whitespace pep8 fixes
Generated using:
autopep8 --in-place --recursive .

Before:
$ pep8 | wc -l
1686

After:
$ pep8 | wc -l
57

A later autopep8 run will be performed using --aggressive, which makes
non-whitespace changes too.
2015-02-15 14:52:31 +00:00
mdoglio 119407ad8e Bug 1097090 - jobs endpoint refactoring
Main changes:
- removed the full parameter on the jobs endpoint, since in both cases the data returned had similar shape/size but slightly different set of attributes.
- removed the exclusion_state parameter in favour of exclusion_profile. The latter allows to specify which profile to apply to the jobs; by default it will use the default profile and can be disabled using exclusion_profile=false
- the data is now returned as a flat list instead of a triple nested structure. As a result the jobs endpoint is now much faster to return data and it allows to easily do basic operations like filtering, sorting, and pagination. Also, it will allow to implement attribute selection with a minimal effort.
- removed the debug parameter in favour of a more explicit return_type (dict|list) that allows a consumer to specify the type of structure expected for the results (dict by default)
- the resultset endpoint doesn't return jobs anymore but only resultsets.
2015-01-30 11:27:05 +00:00
Jonathan French dbb4d11e09 Bug 1090689 - Add MPL2.0 headers to the repo 2014-11-03 13:06:03 -05:00
Jonathan Eads 42c7be37d6 fixed option collection bug 2013-11-06 19:50:07 -08:00
Jonathan Eads 9897261392 removed print 2013-11-06 10:59:15 -08:00
mdoglio 768a26da1d all tests passing 2013-11-06 18:56:18 +00:00
mdoglio 19b66ecf0d fix job state change and update to master 2013-09-18 15:55:39 +02:00
mdoglio dd38c4d747 add/fix a bunch of tests for the pushlog-related changes 2013-09-04 15:52:20 +01:00
mdoglio 6ec69ebf51 first e2e tests passing 2013-07-23 17:39:47 +01:00
mdoglio ec40464ee5 first attemp of a end2end test 2013-07-18 14:47:58 +01:00