Skip to content

Commit

Permalink
Change tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MasloMaslane committed Oct 9, 2023
1 parent f9b945e commit 4368b63
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions tests/commands/doc/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from sinol_make import configure_parsers
from sinol_make.commands.doc import Command
from sinol_make.helpers import paths
from tests.fixtures import create_package
from tests import util

Expand Down Expand Up @@ -36,20 +37,9 @@ def test_argument(capsys, create_package):
out = capsys.readouterr().out
assert "Compilation was successful for all files." in out

logs_exist = False
logs_dir = paths.get_cache_path('doc_logs')
for pattern in command.LOG_PATTERNS:
assert glob.glob(os.path.join(os.getcwd(), 'doc', pattern)) == []


@pytest.mark.parametrize("create_package", [util.get_doc_package_path()], indirect=True)
def test_logs_flag(create_package):
"""
Test --logs flag.
"""
parser = configure_parsers()
args = parser.parse_args(["doc", "--logs"])
command = Command()
command.run(args)

for pattern in command.LOG_PATTERNS:
for file in glob.glob(os.path.join(os.getcwd(), 'doc', pattern)):
assert os.path.exists(file)
logs_exist = logs_exist | (glob.glob(os.path.join(logs_dir, pattern)) != [])
assert logs_exist

0 comments on commit 4368b63

Please sign in to comment.