From 7049b166a55717161460a8b9559dd5cb5c424e96 Mon Sep 17 00:00:00 2001
From: dh00601 <dh00601@surrey.ac.uk>
Date: Mon, 1 Nov 2021 13:56:26 +0000
Subject: [PATCH] updated test for temp file

---
 binarycpython/tests/test_functions.py | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/binarycpython/tests/test_functions.py b/binarycpython/tests/test_functions.py
index eb02619d5..ec36afb5c 100644
--- a/binarycpython/tests/test_functions.py
+++ b/binarycpython/tests/test_functions.py
@@ -110,13 +110,17 @@ class test_temp_dir(unittest.TestCase):
         binary_c_temp_dir = temp_dir()
         general_temp_dir = tempfile.gettempdir()
 
+        # Get username
+        username = get_username()
+        dirname = "binary_c_python-{}".format(username)
+
+        #
         self.assertTrue(
-            os.path.isdir(os.path.join(general_temp_dir, "binary_c_python"))
+            os.path.isdir(os.path.join(general_temp_dir, dirname))
         )
         self.assertTrue(
-            os.path.join(general_temp_dir, "binary_c_python")
-        ) == binary_c_temp_dir
-
+            os.path.join(general_temp_dir, dirname) == binary_c_temp_dir
+        ) 
 
 class test_create_hdf5(unittest.TestCase):
     """
-- 
GitLab