mirror of
https://github.com/novoid/date2name.git
synced 2026-02-16 12:54:15 +00:00
Merge pull request #18 from nbehrnd/re_02b
remove version test on date2name
This commit is contained in:
commit
64c9599f41
2 changed files with 15 additions and 33 deletions
11
test_date2name.py
Normal file → Executable file
11
test_date2name.py
Normal file → Executable file
|
|
@ -4,7 +4,7 @@
|
|||
# author: nbehrnd@yahoo.com
|
||||
# license: GPL v3, 2021.
|
||||
# date: 2021-08-30 (YYYY-MM-DD)
|
||||
# edit: 2021-09-29 (YYYY-MM-DD)
|
||||
# edit: 2021-11-25 (YYYY-MM-DD)
|
||||
#
|
||||
"""Test pad for functions by date2name with pytest.
|
||||
|
||||
|
|
@ -87,15 +87,6 @@ def test_script_existence():
|
|||
"""Merely check for the script's presence."""
|
||||
assert os.path.isfile(PROGRAM)
|
||||
|
||||
|
||||
@pytest.mark.elementary
|
||||
def test_script_version():
|
||||
"""Check for the correct output of the version.
|
||||
|
||||
CLI equivalence: date2name --version """
|
||||
out = getoutput(f"python3 {PROGRAM} --version")
|
||||
assert out.strip() == "__init__.py 2018-05-09"
|
||||
|
||||
@pytest.mark.files
|
||||
@pytest.mark.default
|
||||
@pytest.mark.parametrize("arg1", [" ", "-f", "--files",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#+NAME: test_generator.org
|
||||
#+AUTHOR: nbehrnd@yahoo.com
|
||||
#+DATE: 2021-09-29 (YYYY-MM-DD)
|
||||
#+DATE: 2021-11-25 (YYYY-MM-DD)
|
||||
# License: GPL3, 2021.
|
||||
|
||||
#+PROPERTY: header-args :tangle yes
|
||||
|
|
@ -135,7 +135,7 @@
|
|||
# author: nbehrnd@yahoo.com
|
||||
# license: GPL v3, 2021.
|
||||
# date: 2021-08-30 (YYYY-MM-DD)
|
||||
# edit: 2021-09-29 (YYYY-MM-DD)
|
||||
# edit: 2021-11-25 (YYYY-MM-DD)
|
||||
#
|
||||
"""Test pad for functions by date2name with pytest.
|
||||
|
||||
|
|
@ -211,35 +211,26 @@
|
|||
#+begin_src python :tangle test_date2name.py
|
||||
@pytest.mark.elementary
|
||||
def test_create_remove_testfile(name=TFILE):
|
||||
"""Merely check if the test file may be written and removed."""
|
||||
prepare_testfile(name=TFILE)
|
||||
assert os.path.isfile(name)
|
||||
os.remove(name)
|
||||
assert os.path.isfile(name) is False
|
||||
"""Merely check if the test file may be written and removed."""
|
||||
prepare_testfile(name=TFILE)
|
||||
assert os.path.isfile(name)
|
||||
os.remove(name)
|
||||
assert os.path.isfile(name) is False
|
||||
|
||||
|
||||
@pytest.mark.elementary
|
||||
def test_create_remove_testfolder(name=TFOLDER):
|
||||
"""Probe the generation/removal of a test folder."""
|
||||
prepare_testfolder(name=TFOLDER)
|
||||
assert os.path.isdir(name)
|
||||
os.rmdir(name)
|
||||
assert os.path.isdir(name) is False
|
||||
"""Probe the generation/removal of a test folder."""
|
||||
prepare_testfolder(name=TFOLDER)
|
||||
assert os.path.isdir(name)
|
||||
os.rmdir(name)
|
||||
assert os.path.isdir(name) is False
|
||||
|
||||
|
||||
@pytest.mark.elementary
|
||||
def test_script_existence():
|
||||
"""Merely check for the script's presence."""
|
||||
assert os.path.isfile(PROGRAM)
|
||||
|
||||
|
||||
@pytest.mark.elementary
|
||||
def test_script_version():
|
||||
"""Check for the correct output of the version.
|
||||
|
||||
CLI equivalence: date2name --version """
|
||||
out = getoutput(f"python3 {PROGRAM} --version")
|
||||
assert out.strip() == "__init__.py 2018-05-09"
|
||||
"""Merely check for the script's presence."""
|
||||
assert os.path.isfile(PROGRAM)
|
||||
#+end_src
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue