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

From 3167b0b1669dcaee6f3ed3c75d024cf0c6acfe39 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/test_load.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/tests/config/test_load.py b/tests/config/test_load.py
index ebe2c0516..93a700877 100644
--- a/tests/config/test_load.py
+++ b/tests/config/test_load.py
@@ -117,6 +117,19 @@ class ConfigLoadingTestCase(unittest.TestCase):
                 ],
             )
 
+        with open(self.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.file, "w") as f:
+            f.write("".join(newcontents))
+
     def generate_config_and_remove_lines_containing(self, needle):
         self.generate_config()
 
-- 
2.31.1