fix: properly remove credentials after test
This commit is contained in:
@@ -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__, "?.?.?")
|
||||
|
||||
|
||||
@@ -239,7 +239,7 @@
|
||||
},
|
||||
"FSSync_NextCloud_Password": {
|
||||
"type": "STRING",
|
||||
"value": "F3P8m-nQHik-NSmb2-mnFEF-s85RE"
|
||||
"value": ""
|
||||
},
|
||||
"FSSync_NextCloud_Path": {
|
||||
"type": "STRING",
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
},
|
||||
"FSSync_NextCloud_Password": {
|
||||
"type": "STRING",
|
||||
"value": "F3P8m-nQHik-NSmb2-mnFEF-s85RE"
|
||||
"value": ""
|
||||
},
|
||||
"FSSync_NextCloud_Path": {
|
||||
"type": "STRING",
|
||||
|
||||
Reference in New Issue
Block a user