def test_status_command(): status = commands.status(test_context, []) assert not status.reads_remote assert not status.writes_remote assert str(status) == "status" status = commands.status(test_context, ["mydir"]) assert str(status) == "status mydir"
def test_status_command(): generic_status = commands.status(context, []) status = hg.status(generic_status) assert not status.writes_remote assert not status.reads_remote assert status.get_command_line() == ["hg", "status"] status_output = """M modified/file A new/file R removed/file C clean/file ! missing/file ? unknown/file I ignored/file """ output = status.process_output(0, StringIO(status_output)) the_list = output.as_list() print the_list assert the_list == [ [StatusOutput.MODIFIED, "modified/file"], [StatusOutput.ADDED, "new/file"], [StatusOutput.REMOVED, "removed/file"], [StatusOutput.CLEAN, "clean/file"], [StatusOutput.MISSING, "missing/file"], [StatusOutput.UNKNOWN, "unknown/file"], [StatusOutput.IGNORED, "ignored/file"] ] assert str(output) == status_output
def test_status_is_secured(): try: status = commands.status(secure_context, [topdir / ".." / "foo"]) assert False, "Expected exception for going above topdir" except commands.SecurityError: pass