fix: properly remove credentials after test

This commit is contained in:
cclecle
2024-03-31 02:19:47 +01:00
parent cb4872d057
commit 7e6aacc82f
3 changed files with 16 additions and 2 deletions

View File

@@ -44,6 +44,7 @@ class TestDabDataSync(unittest.TestCase):
nextcloud_pwd = pwd_file.read()
else:
raise RuntimeError("NextCloud pwd file not found")
files = glob.glob(str(testdir_path / "*.json"))
files += glob.glob(str(testdir_path / "*.json"))
for file in files:
@@ -61,6 +62,19 @@ class TestDabDataSync(unittest.TestCase):
shutil.rmtree(testdir_path / "test_data", ignore_errors=True)
shutil.rmtree(testdir_path / "test_data2", ignore_errors=True)
files = glob.glob(str(testdir_path / "*.json"))
files += glob.glob(str(testdir_path / "*.json"))
for file in files:
with open(file) as f:
data = json.load(f)
try:
data["Args"]["FSSync_NextCloud_Password"]["value"] = ""
except Exception:
pass
os.remove(file)
with open(file, "w") as f:
json.dump(data, f, sort_keys=True, indent=4)
def test_version(self):
self.assertNotEqual(dabdatasync.__version__, "?.?.?")

View File

@@ -239,7 +239,7 @@
},
"FSSync_NextCloud_Password": {
"type": "STRING",
"value": "F3P8m-nQHik-NSmb2-mnFEF-s85RE"
"value": ""
},
"FSSync_NextCloud_Path": {
"type": "STRING",

View File

@@ -11,7 +11,7 @@
},
"FSSync_NextCloud_Password": {
"type": "STRING",
"value": "F3P8m-nQHik-NSmb2-mnFEF-s85RE"
"value": ""
},
"FSSync_NextCloud_Path": {
"type": "STRING",