File matrix-synapse-test-paths.patch of Package matrix-synapse

From bdd03944291804f78d9d1fec98cdff71c48579db Mon Sep 17 00:00:00 2001
From: Oleg Girko <ol@infoserver.lv>
Date: Wed, 22 Aug 2018 19:45:32 +0100
Subject: [PATCH] Configure tests to use media_store and uploads in current
 directory.

Signed-off-by: Oleg Girko <ol@infoserver.lv>
---
 tests/config/utils.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/tests/config/utils.py b/tests/config/utils.py
index 94c18a052b..1525cd0582 100644
--- a/tests/config/utils.py
+++ b/tests/config/utils.py
@@ -43,6 +43,19 @@ class ConfigFileTestCase(unittest.TestCase):
                 ],
             )
 
+        with open(self.config_file, "r") as f:
+            contents = f.readlines()
+        newcontents = []
+        for l in contents:
+            if l.startswith("media_store_path: "):
+                newcontents.append('media_store_path: "%s"\n' % os.path.abspath("media_store"))
+            elif l.startswith("uploads_path: "):
+                newcontents.append('uploads_path: "%s"\n' % os.path.abspath("uploads"))
+            else:
+                newcontents.append(l)
+        with open(self.config_file, "w") as f:
+            f.write("".join(newcontents))
+
     def generate_config_and_remove_lines_containing(self, needle):
         self.generate_config()
 
-- 
2.35.3