File: test_issue45_cli_returncodes.py

package info (click to toggle)
segno 1.6.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,068 kB
  • sloc: python: 9,936; makefile: 162; javascript: 16
file content (29 lines) | stat: -rw-r--r-- 614 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#
# Copyright (c) 2016 - 2024 -- Lars Heuer
# All rights reserved.
#
# License: BSD License
#
"""\
Tests against issue #45.
<https://github.com/heuer/segno/issues/45>
"""
from segno import cli
import pytest


def test_issue_45_error(capsys):
    try:
        cli.main(['--version=M1', '--seq', '"This is a test"'])
    except SystemExit as ex:
        assert 1 == ex.code
        assert capsys.readouterr()


def test_issue_45_no_error():
    assert 0 == cli.main(['--version=1', '--seq',
                          '"This is a test, test test test test"'])


if __name__ == '__main__':
    pytest.main([__file__])