From 1784fdfe7b07a852744f4012c333a110794e923c Mon Sep 17 00:00:00 2001 From: Sayat Aubakirov Date: Tue, 30 Jul 2024 18:47:34 +0500 Subject: [PATCH] modify tests/test_parse.py --- tests/test_parse.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/test_parse.py b/tests/test_parse.py index 2bebd0d..dfd1982 100644 --- a/tests/test_parse.py +++ b/tests/test_parse.py @@ -1,13 +1,15 @@ from gendiff.parse import load_file, define_extension import json import yaml +import pytest -def test_define_extension(): - file_path = 'tests/fixtures/file1.json' - file_path2 = 'tests/fixtures/plain_yml_file1.yaml' - assert define_extension(file_path) == '.json' - assert define_extension(file_path2) == '.yaml' +@pytest.mark.parametrize("file_path, expected_result", [ + ('tests/fixtures/file1.json', '.json'), + ('tests/fixtures/plain_yml_file1.yaml', '.yaml') +]) +def test_define_extension(file_path, expected_result): + assert define_extension(file_path) == expected_result def test_load_file():