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

From 997228c8b9f763a5307673aa8b234792d8610ee1 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 11140ff979..70652534ba 100644
--- a/tests/config/utils.py
+++ b/tests/config/utils.py
@@ -51,6 +51,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: str) -> None:
         self.generate_config()
 
-- 
2.46.0