mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-15 01:51:46 +04:00
Move commands into their own files.
This commit is contained in:
parent
111ed02938
commit
cdfd3f7670
16 changed files with 736 additions and 673 deletions
20
tests/commands/clean_test.py
Normal file
20
tests/commands/clean_test.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import os.path
|
||||
import shutil
|
||||
|
||||
from pre_commit.commands.clean import clean
|
||||
|
||||
|
||||
def test_clean(runner_with_mocked_store):
|
||||
assert os.path.exists(runner_with_mocked_store.store.directory)
|
||||
clean(runner_with_mocked_store)
|
||||
assert not os.path.exists(runner_with_mocked_store.store.directory)
|
||||
|
||||
|
||||
def test_clean_empty(runner_with_mocked_store):
|
||||
"""Make sure clean succeeds when we the directory doesn't exist."""
|
||||
shutil.rmtree(runner_with_mocked_store.store.directory)
|
||||
assert not os.path.exists(runner_with_mocked_store.store.directory)
|
||||
clean(runner_with_mocked_store)
|
||||
assert not os.path.exists(runner_with_mocked_store.store.directory)
|
||||
Loading…
Add table
Add a link
Reference in a new issue