diff options
Diffstat (limited to 'test_utils/src/lib.rs')
| -rw-r--r-- | test_utils/src/lib.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/test_utils/src/lib.rs b/test_utils/src/lib.rs index ff1f41b..bf6c37b 100644 --- a/test_utils/src/lib.rs +++ b/test_utils/src/lib.rs | |||
| @@ -952,17 +952,20 @@ where | |||
| 952 | } | 952 | } |
| 953 | 953 | ||
| 954 | fn backup_existing_config() -> Result<()> { | 954 | fn backup_existing_config() -> Result<()> { |
| 955 | let config_path = get_dirs().config_dir().join("config.json"); | 955 | let config_path = get_dirs().config_dir().join("cache.sqlite"); |
| 956 | let backup_config_path = get_dirs().config_dir().join("config-backup.json"); | 956 | let backup_config_path = get_dirs().config_dir().join("cache-backup.sqlite"); |
| 957 | if !backup_config_path.exists() { | ||
| 958 | std::fs::rename(&config_path, backup_config_path)?; | ||
| 959 | } | ||
| 957 | if config_path.exists() { | 960 | if config_path.exists() { |
| 958 | std::fs::rename(config_path, backup_config_path)?; | 961 | std::fs::remove_file(&config_path)?; |
| 959 | } | 962 | } |
| 960 | Ok(()) | 963 | Ok(()) |
| 961 | } | 964 | } |
| 962 | 965 | ||
| 963 | fn restore_config_backup() -> Result<()> { | 966 | fn restore_config_backup() -> Result<()> { |
| 964 | let config_path = get_dirs().config_dir().join("config.json"); | 967 | let config_path = get_dirs().config_dir().join("cache.sqlite"); |
| 965 | let backup_config_path = get_dirs().config_dir().join("config-backup.json"); | 968 | let backup_config_path = get_dirs().config_dir().join("cache-backup.sqlite"); |
| 966 | if config_path.exists() { | 969 | if config_path.exists() { |
| 967 | std::fs::remove_file(&config_path)?; | 970 | std::fs::remove_file(&config_path)?; |
| 968 | } | 971 | } |