This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Use a regular HomeServerConfig object for unit tests #4889
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fixes a bug where hs_disabled_message was not enforced for 3pid-based requests if there was no server_notices_mxid configured.
The Mailer expects the config object to have `email_smtp_pass` and `email_riot_base_url` attributes (and it won't by default, because the default config impl doesn't set any of the attributes unless email_enable_notifs is set).
* Set allow_guest_access = True, since we rely on it * config doesn't have a `hostname` attribute; it is `server_name`
Make sure that we have a `server_notices_mxid` set, given that we are relying on it.
Rather than using a Mock for the homeserver config, use a genuine HomeServerConfig object. This makes for a more realistic test, and means that we don't have to keep remembering to add things to the mock config every time we add a new config setting.
richvdh
force-pushed
the
rav/test_real_config
branch
from
March 19, 2019 11:44
29aefd2
to
07f057a
Compare
Codecov Report
@@ Coverage Diff @@
## develop #4889 +/- ##
==========================================
Coverage ? 73.34%
==========================================
Files ? 326
Lines ? 33953
Branches ? 5600
==========================================
Hits ? 24902
Misses ? 7410
Partials ? 1641 |
Codecov Report
@@ Coverage Diff @@
## develop #4889 +/- ##
===========================================
+ Coverage 77.9% 77.93% +0.03%
===========================================
Files 326 326
Lines 33952 33958 +6
Branches 5598 5601 +3
===========================================
+ Hits 26449 26464 +15
+ Misses 5885 5872 -13
- Partials 1618 1622 +4 |
turns out this relies on there being a `user_consent_version` set.
erikjohnston
approved these changes
Mar 19, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rather than using a Mock for the homeserver config, use a genuine
HomeServerConfig
object. This makes for a more realistic test, and means that we don't have to keep remembering to add things to the mock config every time we add a new config setting.It even found a bug (cf #4888, on which this PR is based).