mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-06 03:56:54 +00:00
added unversioned files
This commit is contained in:
parent
bc7315b861
commit
71ee80081d
53 changed files with 1178 additions and 0 deletions
0
pre_commit_hooks/loaderon_hooks/tests/util/__init__.py
Normal file
0
pre_commit_hooks/loaderon_hooks/tests/util/__init__.py
Normal file
17
pre_commit_hooks/loaderon_hooks/tests/util/test_helpers.py
Normal file
17
pre_commit_hooks/loaderon_hooks/tests/util/test_helpers.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import os
|
||||
import sys
|
||||
|
||||
|
||||
def get_sample_file_path(file_name):
|
||||
current_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
testing_files_folder_path = current_path + '/testing_samples/'
|
||||
return testing_files_folder_path + file_name
|
||||
|
||||
|
||||
def perform_test_on_file_expecting_result(file_name, test_function, expected_result=0):
|
||||
sample_file_path = get_sample_file_path(file_name)
|
||||
sys.argv.append(sample_file_path)
|
||||
|
||||
result = test_function(sys.argv)
|
||||
|
||||
assert result == expected_result
|
||||
Loading…
Add table
Add a link
Reference in a new issue