mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-06 07:34:22 -04:00
Run Black. (#5482)
This commit is contained in:
parent
7dcf984075
commit
32e7c9e7f2
376 changed files with 9142 additions and 10388 deletions
|
@ -42,17 +42,17 @@ class ConsentResourceTestCase(unittest.HomeserverTestCase):
|
|||
# Make some temporary templates...
|
||||
temp_consent_path = self.mktemp()
|
||||
os.mkdir(temp_consent_path)
|
||||
os.mkdir(os.path.join(temp_consent_path, 'en'))
|
||||
os.mkdir(os.path.join(temp_consent_path, "en"))
|
||||
|
||||
config["user_consent"] = {
|
||||
"version": "1",
|
||||
"template_dir": os.path.abspath(temp_consent_path),
|
||||
}
|
||||
|
||||
with open(os.path.join(temp_consent_path, "en/1.html"), 'w') as f:
|
||||
with open(os.path.join(temp_consent_path, "en/1.html"), "w") as f:
|
||||
f.write("{{version}},{{has_consented}}")
|
||||
|
||||
with open(os.path.join(temp_consent_path, "en/success.html"), 'w') as f:
|
||||
with open(os.path.join(temp_consent_path, "en/success.html"), "w") as f:
|
||||
f.write("yay!")
|
||||
|
||||
hs = self.setup_test_homeserver(config=config)
|
||||
|
@ -88,7 +88,7 @@ class ConsentResourceTestCase(unittest.HomeserverTestCase):
|
|||
self.assertEqual(channel.code, 200)
|
||||
|
||||
# Get the version from the body, and whether we've consented
|
||||
version, consented = channel.result["body"].decode('ascii').split(",")
|
||||
version, consented = channel.result["body"].decode("ascii").split(",")
|
||||
self.assertEqual(consented, "False")
|
||||
|
||||
# POST to the consent page, saying we've agreed
|
||||
|
@ -111,6 +111,6 @@ class ConsentResourceTestCase(unittest.HomeserverTestCase):
|
|||
|
||||
# Get the version from the body, and check that it's the version we
|
||||
# agreed to, and that we've consented to it.
|
||||
version, consented = channel.result["body"].decode('ascii').split(",")
|
||||
version, consented = channel.result["body"].decode("ascii").split(",")
|
||||
self.assertEqual(consented, "True")
|
||||
self.assertEqual(version, "1")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue