Replace resources with importlib_resources

This commit is contained in:
Anthony Sottile 2018-10-14 13:17:38 -07:00
parent ebe5132576
commit 9f60561d6f
17 changed files with 72 additions and 49 deletions

View file

@ -153,3 +153,12 @@ def test_require_created_when_directory_exists_but_not_db(store):
os.makedirs(store.directory)
store.require_created()
assert os.path.exists(store.db_path)
def test_local_resources_reflects_reality():
on_disk = {
res[len('empty_template_'):]
for res in os.listdir('pre_commit/resources')
if res.startswith('empty_template_')
}
assert on_disk == set(Store.LOCAL_RESOURCES)