new tests for check line.

refactoring common code: sent to new tests util file
This commit is contained in:
Alvaro Andrés Rodríguez Scelza 2019-06-07 12:58:07 -03:00
parent ae4b423b45
commit d327922f34
6 changed files with 82 additions and 25 deletions

View 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_files/'
return testing_files_folder_path + file_name
def perform_test_on_file_expecting_result(file_name, main_function, expected_result=0):
sample_file_path = get_sample_file_path(file_name)
sys.argv.append(sample_file_path)
result = main_function(sys.argv)
assert result == expected_result