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

Tests: User to be warned about incorrect delimiter #263

Merged
merged 1 commit into from
May 27, 2022

Conversation

miskopo
Copy link
Member

@miskopo miskopo commented May 27, 2022

Test if the error message is descriptive and informative when incorrect
delimiter is supplied in the configuration file.

Related: https://bugzilla.redhat.com/show_bug.cgi?id=2079739

Signed-off-by: Michal Polovka mpolovka@redhat.com

@miskopo miskopo self-assigned this May 27, 2022
@miskopo miskopo requested a review from rcritten May 27, 2022 08:58
@miskopo miskopo added the wip Work in progress - do not merge even if CI passes label May 27, 2022
Test if the error message is descriptive and informative when incorrect
delimiter is supplied in the configuration file.

Related: https://bugzilla.redhat.com/show_bug.cgi?id=2079739

Signed-off-by: Michal Polovka <mpolovka@redhat.com>
@miskopo miskopo removed the wip Work in progress - do not merge even if CI passes label May 27, 2022
@miskopo
Copy link
Member Author

miskopo commented May 27, 2022

Since caplog may seem shaby, I've also tested negative scenario and it seems to be working as expected.

>           assert "mumbo jumbo" in caplog.text
E           assert 'mumbo jumbo' in "ERROR    root:config.py:94 Unable to parse /tmp/tmpio_skpj3: Source contains parsing errors: '/tmp/tmpio_skpj3'\n\t[line  2]: 'output_type;human\\n'\n"
E            +  where "ERROR    root:config.py:94 Unable to parse /tmp/tmpio_skpj3: Source contains parsing errors: '/tmp/tmpio_skpj3'\n\t[line  2]: 'output_type;human\\n'\n" = <_pytest.logging.LogCaptureFixture object at 0x7f141af274f0>.text

tests/test_options.py:138: AssertionError

@rcritten
Copy link
Collaborator

I think using the caplog fixture from pytest is pretty clever. This LGTM.

@rcritten rcritten added the ack label May 27, 2022
@rcritten rcritten merged commit 25fa4f3 into freeipa:master May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants