summary refs log tree commit diff
path: root/tests/server.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'develop' into rav/pass_site_to_make_requestRichard van der Hoff2020-11-161-1/+10
|\
| * Add a `custom_headers` param to `make_request` (#8760)Richard van der Hoff2020-11-161-1/+10
| | | | | | | | Some tests want to set some custom HTTP request headers, so provide a way to do that before calling requestReceived().
* | fix dict handling for make_request()Richard van der Hoff2020-11-151-0/+2
| |
* | pass a Site into make_requestRichard van der Hoff2020-11-151-1/+15
|/
* Fix race for concurrent downloads of remote media. (#8682)Erik Johnston2020-10-301-1/+1
| | | Fixes #6755
* Support generating structured logs in addition to standard logs. (#8607)Patrick Cloke2020-10-291-3/+1
| | | | | | | This modifies the configuration of structured logging to be usable from the standard Python logging configuration. This also separates the formatting of logs from the transport allowing JSON logs to files or standard logs to sockets.
* Tell Black to format code for Python 3.5 (#8664)Dan Callahan2020-10-271-2/+2
| | | | | | | | This allows trailing commas in multi-line arg lists. Minor, but we might as well keep our formatting current with regard to our minimum supported Python version. Signed-off-by: Dan Callahan <danc@element.io>
* Clean-up some broken/unused code in the test framework (#8514)Patrick Cloke2020-10-091-2/+0
|
* Fix threadsafety in ThreadedMemoryReactorClock (#8497)Richard van der Hoff2020-10-091-4/+32
| | | | | | | | | | | | | | | | | | | | | This could, very occasionally, cause: ``` tests.test_visibility.FilterEventsForServerTestCase.test_large_room =============================================================================== [ERROR] Traceback (most recent call last): File "/src/tests/rest/media/v1/test_media_storage.py", line 86, in test_ensure_media_is_in_local_cache self.wait_on_thread(x) File "/src/tests/unittest.py", line 296, in wait_on_thread self.reactor.advance(0.01) File "/src/.tox/py35/lib/python3.5/site-packages/twisted/internet/task.py", line 826, in advance self._sortCalls() File "/src/.tox/py35/lib/python3.5/site-packages/twisted/internet/task.py", line 787, in _sortCalls self.calls.sort(key=lambda a: a.getTime()) builtins.ValueError: list modified during sort tests.rest.media.v1.test_media_storage.MediaStorageTests.test_ensure_media_is_in_local_cache ```
* Speed up unit tests when using PostgreSQL (#8450)Erik Johnston2020-10-021-0/+4
|
* Simplify super() calls to Python 3 syntax. (#8344)Patrick Cloke2020-09-181-1/+1
| | | | | | | This converts calls like super(Foo, self) -> super(). Generated with: sed -i "" -Ee 's/super\([^\(]+\)/super()/g' **/*.py
* Show a confirmation page during user password reset (#8004)Andrew Morgan2020-09-101-2/+13
| | | | | This PR adds a confirmation step to resetting your user password between clicking the link in your email and your password actually being reset. This is to better align our password reset flow with the industry standard of requiring a confirmation from the user after email validation.
* Stop sub-classing object (#8249)Patrick Cloke2020-09-041-3/+3
|
* Fix client reader sharding tests (#7853)Erik Johnston2020-07-151-1/+25
| | | | | | | | | | | | | | | * Fix client reader sharding tests * Newsfile * Fix typing * Update changelog.d/7853.misc Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com> * Move mocking of http_client to tests Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
* Replace all remaining six usage with native Python 3 equivalents (#7704)Dagfinn Ilmari Mannsåker2020-06-161-3/+1
|
* Kill off redundant SynapseRequestFactory (#6619)Richard van der Hoff2020-01-031-2/+4
| | | | We already get the Site via the Channel, so there's no need for a dedicated RequestFactory: we can just use the right constructor.
* Add database config class (#6513)Erik Johnston2019-12-181-27/+28
| | | | | This encapsulates config for a given database and is the way to get new connections.
* Improve the performance of structured logging (#6322)Amber Brown2019-11-261-0/+2
|
* Support for routing outbound HTTP requests via a proxy (#6239)Richard van der Hoff2019-11-011-2/+22
| | | | | | | | | | | | | | | | | | | | The `http_proxy` and `HTTPS_PROXY` env vars can be set to a `host[:port]` value which should point to a proxy. The address of the proxy should be excluded from IP blacklists such as the `url_preview_ip_range_blacklist`. The proxy will then be used for * push * url previews * phone-home stats * recaptcha validation * CAS auth validation It will *not* be used for: * Application Services * Identity servers * Outbound federation * In worker configurations, connections from workers to masters Fixes #4198.
* Add unit test for /purge_room APIErik Johnston2019-10-311-1/+5
|
* Remove unnecessary parentheses around return statements (#5931)Andrew Morgan2019-08-301-1/+1
| | | | | Python will return a tuple whether there are parentheses around the returned values or not. I'm just sick of my editor complaining about this all over the place :)
* Implement a structured logging output system. (#5680)Amber Brown2019-08-281-2/+25
|
* Run Black. (#5482)Amber Brown2019-06-201-8/+8
|
* Migrate all tests to use the dict-based config format instead of hanging ↵Amber Brown2019-05-131-27/+34
| | | | items off HomeserverConfig (#5171)
* Run Black on the tests again (#5170)Amber Brown2019-05-101-3/+4
|
* Fix sync bug when accepting invites (#4956)Richard van der Hoff2019-04-021-21/+35
| | | | | | | | | | Hopefully this time we really will fix #4422. We need to make sure that the cache on `get_rooms_for_user_with_stream_ordering` is invalidated *before* the SyncHandler is notified for the new events, and we can now do so reliably via the `events` stream.
* Log requests which are simulated by the unit tests. (#4905)Richard van der Hoff2019-03-201-8/+1
| | | | Rather than stubbing out the access_log, make it actually log the requests, which makes it a lot more obvious what is going on during tests.
* Update test_typing to use HomeserverTestCase. (#4771)Richard van der Hoff2019-03-041-6/+15
|
* Add a caching layer to .well-known responses (#4516)Richard van der Hoff2019-01-301-4/+14
|
* Implement MSC1708 (.well-known lookups for server routing) (#4489)Richard van der Hoff2019-01-291-2/+11
|
* Use SimpleResolverComplexifier in tests (#4497)Richard van der Hoff2019-01-291-28/+13
| | | | | two reasons for this. One, it saves a bunch of boilerplate. Two, it squashes unicode to IDNA-in-a-`str` (even on python 3) in a way that it turns out we rely on to give consistent behaviour between python 2 and 3.
* fix python2 test failureRichard van der Hoff2019-01-231-1/+1
|
* Add a test for MatrixFederationAgentRichard van der Hoff2019-01-221-1/+12
|
* Fix IP URL previews on Python 3 (#4215)Amber Brown2018-12-221-0/+8
|
* Fix Content-Disposition in media repository (#4176)Amber Brown2018-11-151-0/+15
|
* Fix URL preview bugs (type error when loading cache from db, content-type ↵Amber Brown2018-11-081-0/+2
| | | | including quotes) (#4157)
* Remove some boilerplate in tests (#4156)Amber Brown2018-11-071-2/+18
|
* Tests for user consent resource (#4140)Amber Brown2018-11-061-3/+17
|
* Fix typing being reset causing infinite syncs (#4127)Amber Brown2018-11-031-1/+7
|
* Write some tests for the email pusher (#4095)Amber Brown2018-10-301-1/+3
|
* Fix client IPs being broken on Python 3 (#3908)Amber Brown2018-09-201-3/+5
|
* Refactor matrixfederationclient to fix logging (#3906)Richard van der Hoff2018-09-181-0/+81
| | | | | | | | We want to wait until we have read the response body before we log the request as complete, otherwise a confusing thing happens where the request appears to have completed, but we later fail it. To do this, we factor the salient details of a request out to a separate object, which can then keep track of the txn_id, so that it can be logged.
* Attempt to figure out what's going on with timeouts (#3857)Amber Brown2018-09-141-1/+41
|
* Port tests/ to Python 3 (#3808)Amber Brown2018-09-071-1/+1
|
* Fix tests on postgresql (#3740)Amber Brown2018-09-041-0/+1
|
* Unit testsErik Johnston2018-08-231-3/+10
|
* Fix the testsAmber Brown2018-08-151-4/+19
|
* Run tests under PostgreSQL (#3423)Amber Brown2018-08-131-2/+8
|
* Run black.black2018-08-101-0/+2
|
* Test fixes for Python 3 (#3647)Amber Brown2018-08-091-2/+20
|
* Refactor REST API tests to use explicit reactors (#3351)Amber Brown2018-07-171-0/+10
|
* Use more portable syntax using attrs package.Oleg Girko2018-07-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Newer syntax attr.ib(factory=dict) is just a syntactic sugar for attr.ib(default=attr.Factory(dict)) It was introduced in newest version of attrs package (18.1.0) and doesn't work with older versions. We should either require minimum version of attrs to be 18.1.0, or use older (slightly more verbose) syntax. Requiring newest version is not a good solution because Linux distributions may have older version of attrs (17.4.0 in Fedora 28), and requiring to build (and package) newer version just to use newer syntactic sugar in only one test is just too much. It's much better to fix that test to use older syntax. Signed-off-by: Oleg Girko <ol@infoserver.lv>
* run isortAmber Brown2018-07-091-4/+6
|
* Better testing framework for homeserver-using things (#3446)Amber Brown2018-06-271-0/+181