Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pav status Regression Test Passing When it Shouldn't #791

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions test/tests/status_cmd_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,12 +301,20 @@ def test_status_history(self):
def test_status_no_run(self):
"""Test that the status command behaves properly when invoked before any tests have run."""

# Create a temporary empty working directory to simulate a fresh install
self.pav_cfg.working_dir = self.pav_cfg.working_dir / "working_dir"
self.pav_cfg.working_dir.mkdir()

status_cmd = commands.get_command('status')
out = io.StringIO()
status_cmd.outfile = out
status_cmd.silence()

parser = argparse.ArgumentParser()
status_cmd._setup_arguments(parser)

args = parser.parse_args([])
self.assertEqual(status_cmd.run(self.pav_cfg, args), 0)
ret = status_cmd.run(self.pav_cfg, args)

# Reset working directory for other tests
self.pav_cfg.working_dir = self.pav_cfg.working_dir.parent

self.assertEqual(ret, 0)
Loading