Skip to content

Commit

Permalink
Update test_search_query.py
Browse files Browse the repository at this point in the history
Renamed attributes comprising parameters for test
methods to better reflect their purpose of usage.
  • Loading branch information
rahul4732saini committed Jul 9, 2024
1 parent 54cad89 commit f615b5a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/test_query/test_search_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
class TestFileSearchQuery:
"""Tests the file search queries."""

basic_query_syntax_params = [
basic_query_syntax_test_params = [
f"R SELECT * FROM '{TEST_DIRECTORY / 'file_dir'}'",
f"SELECT[TYPE FILE] name, filetype FROM '{TEST_DIRECTORY / 'file_dir'}'",
f"RECURSIVE SELECT * FROM '{TEST_DIRECTORY}' WHERE filetype = '.py'",
]

mixed_case_query_params = [
mixed_case_query_test_params = [
f"r Select * FroM '{TEST_DIRECTORY / 'file_dir'}'",
f"sELect[TYPE FILE] Name, FileType From '{TEST_DIRECTORY / 'file_dir'}'",
f"RecURSive sELECt * From '{TEST_DIRECTORY}' wHErE FilETypE = '.py'",
Expand All @@ -34,7 +34,7 @@ class TestFileSearchQuery:
# Some of the test don't explicitly verify the extracted data as it is flexible and
# subject to change depending on the system and path the tests are executed from.

@pytest.mark.parametrize("query", basic_query_syntax_params)
@pytest.mark.parametrize("query", basic_query_syntax_test_params)
def test_basic_query_syntax(self, query: str) -> None:
"""Tests the basic file search query syntax."""

Expand All @@ -54,7 +54,7 @@ def test_individual_fields(self, field: str) -> None:
# comprising characters of mixed cases, and hence uses the file and directory records
# stored at the same path in the `test_delete_query.hdf` file.

@pytest.mark.parametrize("query", mixed_case_query_params)
@pytest.mark.parametrize("query", mixed_case_query_test_params)
def test_mixed_case_query(self, query: str) -> None:
"""Tests file search queries comprising characters of mixed cases."""

Expand All @@ -65,13 +65,13 @@ def test_mixed_case_query(self, query: str) -> None:
class TestDirSearchQuery:
"""Tests the directory search queries."""

basic_query_syntax_params = [
basic_query_syntax_test_params = [
f"R SELECT[TYPE DIR] * FROM '{TEST_DIRECTORY / 'file_dir'}'",
f"SELECT[TYPE DIR] name, parent, ctime FROM '{TEST_DIRECTORY / 'file_dir'}'",
f"RECURSIVE SELECT[TYPE DIR] * FROM '{TEST_DIRECTORY}' WHERE name IN ('orders', 'reports')",
]

mixed_case_query_params = [
mixed_case_query_test_params = [
f"r SELECT[Type DiR] * fROm '{TEST_DIRECTORY / 'file_dir'}'",
f"sEleCt[typE dIr] name, parent, ctime FroM '{TEST_DIRECTORY / 'file_dir'}'",
f"Recursive Select[TYPE DIR] * From '{TEST_DIRECTORY}' Where name In ('orders', 'reports')",
Expand All @@ -82,7 +82,7 @@ class TestDirSearchQuery:
# Some of the test don't explicitly verify the extracted data as it is flexible and
# subject to change depending on the system and path the tests are executed from.

@pytest.mark.parametrize("query", basic_query_syntax_params)
@pytest.mark.parametrize("query", basic_query_syntax_test_params)
def test_basic_query_syntax(self, query: str) -> None:
"""Tests the basic directory search query syntax."""

Expand All @@ -102,7 +102,7 @@ def test_individual_fields(self, field: str) -> None:
# comprising characters of mixed cases, and hence uses the file and directory records
# stored at the same path in the `test_delete_query.hdf` file.

@pytest.mark.parametrize("query", mixed_case_query_params)
@pytest.mark.parametrize("query", mixed_case_query_test_params)
def test_mixed_case_query(self, query: str) -> None:
"""Tests directory search queries comprising characters of mixed cases."""

Expand Down

0 comments on commit f615b5a

Please sign in to comment.