mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2025-09-09 07:48:57 +00:00
Add schema v4 migration and update tests
This commit is contained in:
@@ -13,7 +13,7 @@ def setup(tmp_path: Path):
|
||||
return enc_mgr, vault
|
||||
|
||||
|
||||
def test_migrate_v0_to_v3(tmp_path: Path):
|
||||
def test_migrate_v0_to_v4(tmp_path: Path):
|
||||
enc_mgr, vault = setup(tmp_path)
|
||||
legacy = {"passwords": {"0": {"website": "a", "length": 8}}}
|
||||
enc_mgr.save_json_data(legacy)
|
||||
@@ -26,11 +26,12 @@ def test_migrate_v0_to_v3(tmp_path: Path):
|
||||
"notes": "",
|
||||
"custom_fields": [],
|
||||
"origin": "",
|
||||
"tags": [],
|
||||
}
|
||||
assert data["entries"]["0"] == expected_entry
|
||||
|
||||
|
||||
def test_migrate_v1_to_v3(tmp_path: Path):
|
||||
def test_migrate_v1_to_v4(tmp_path: Path):
|
||||
enc_mgr, vault = setup(tmp_path)
|
||||
legacy = {"schema_version": 1, "passwords": {"0": {"website": "b", "length": 10}}}
|
||||
enc_mgr.save_json_data(legacy)
|
||||
@@ -43,11 +44,12 @@ def test_migrate_v1_to_v3(tmp_path: Path):
|
||||
"notes": "",
|
||||
"custom_fields": [],
|
||||
"origin": "",
|
||||
"tags": [],
|
||||
}
|
||||
assert data["entries"]["0"] == expected_entry
|
||||
|
||||
|
||||
def test_migrate_v2_to_v3(tmp_path: Path):
|
||||
def test_migrate_v2_to_v4(tmp_path: Path):
|
||||
enc_mgr, vault = setup(tmp_path)
|
||||
legacy = {
|
||||
"schema_version": 2,
|
||||
@@ -65,6 +67,7 @@ def test_migrate_v2_to_v3(tmp_path: Path):
|
||||
"notes": "",
|
||||
"custom_fields": [],
|
||||
"origin": "",
|
||||
"tags": [],
|
||||
}
|
||||
assert data["entries"]["0"] == expected_entry
|
||||
|
||||
|
Reference in New Issue
Block a user