Skip to content

Commit

Permalink
[Test] Rename pytests to <something>_test.py; rename test-cases
Browse files Browse the repository at this point in the history
To be consistent with conventional test-code naming conventions,
this commit renames existing pytest files to <something>_test.py
E.g., test_gen_loc_files_basic.py -> gen_loc_files_basic_test.py

Individual test-cases are already named as test_<something>;
E.g., in above test file, test method is named: test_loc_main_script_dir()
and so on.
  • Loading branch information
gapisback committed Apr 11, 2024
1 parent 6a3f7c5 commit edc2d47
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
6 changes: 3 additions & 3 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ From: Apache site

A small collection of pytest tests exist to verify the LOC-generator

- test_gen_loc_files_basic.py - Exercises basic generator functionality
- test_gen_loc_files_oss_code_bases.py - Exercises the LOC generator script on
above set of OSS source code bases. (This works offline on a private machine.)
- gen\_loc\_files\_basic\_test.py - Exercises basic generator functionality
- gen\_loc\_files\_oss\_code\_bases\_test.py - Exercises the LOC generator script on
above set of OSS source code bases. (This works offline on a private machine.)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# #############################################################################
# test_gen_loc_files_basic.py
# gen_loc_files_basic_test.py
#
"""
Collection of basic test cases to exercise the LOC generation machinery
Expand Down Expand Up @@ -29,7 +29,7 @@

# #############################################################################
# To see output from test-cases run:
# $ pytest --capture=tee-sys tests/test_gen_loc_files_basic.py -k test_loc_main_scriptdir
# $ pytest --capture=tee-sys tests/gen_loc_files_basic_test.py -k test_loc_main_scriptdir
# #############################################################################
def test_loc_main_script_dir():
"""
Expand Down Expand Up @@ -69,7 +69,7 @@ def test_help():
this raises() exception block to let the test case pass.
If you want to see the --help output, do:
$ pytest --capture=tee-sys tests/test_gen_loc_files_basic.py -k test_help
$ pytest --capture=tee-sys tests/gen_loc_files_basic_test.py -k test_help
"""
with pytest.raises(SystemExit):
loc_main.loc_parse_args(['--help'])
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# #############################################################################
# test_gen_loc_files_oss_code_bases.py
# gen_loc_files_oss_code_bases_test.py
#
"""
Exercise LOC py-generator on a collection of OSS code-bases that have
Expand All @@ -26,8 +26,6 @@
LocDirsParent = os.path.realpath(LocDirRoot + '/..')

# #############################################################################
# To see output from test-cases run:
# $ pytest --capture=tee-sys tests/test_gen_loc_files_basic.py -k test_loc_main_scriptdir
# pylint: disable-msg=line-too-long
# Ref: https://stackoverflow.com/questions/800197/how-to-get-all-of-the-immediate-subdirectories-in-python
# https://docs.python.org/3/tutorial/inputoutput.html
Expand Down
5 changes: 1 addition & 4 deletions tests/test_loc_xform.py → tests/loc_xform_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# #############################################################################
# test_loc_xform.py
# loc_xform_test.py
#
"""
Basic unit-test for LOC encode / decode Python methods.
Expand All @@ -11,9 +11,6 @@
# #############################################################################
# Setup some variables pointing to diff dir/sub-dir full-paths.

# #############################################################################
# To see output from test-cases run:
# $ pytest --capture=tee-sys tests/test_gen_loc_files_basic.py -k test_loc_main_scriptdir
# #############################################################################
def test_loc_encode():
"""
Expand Down

0 comments on commit edc2d47

Please sign in to comment.