GIVEN no existing cache WHEN save is called but there are (new entries/no entries in memory) THEN it should (create/not create) the file
(self, isolated_fs, with_entry)
| 67 | |
| 68 | @pytest.mark.parametrize("with_entry", [True, False]) |
| 69 | def test_save_cache_first_time(self, isolated_fs, with_entry): |
| 70 | """ |
| 71 | GIVEN no existing cache |
| 72 | WHEN save is called but there are (new entries/no entries in memory) |
| 73 | THEN it should (create/not create) the file |
| 74 | """ |
| 75 | cache = Cache() |
| 76 | if with_entry: |
| 77 | cache.update_cache(last_found_secrets=[{"match": "XXX"}]) |
| 78 | cache.save() |
| 79 | |
| 80 | assert os.path.isfile(".cache_ggshield") is with_entry |
| 81 | |
| 82 | def test_max_commits_for_hook_setting(self): |
| 83 | """ |
nothing calls this directly
no test coverage detected