Created
November 27, 2020 20:56
-
-
Save petri/52103a83f9ba31682898e9498f4e9da6 to your computer and use it in GitHub Desktop.
test example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test_cmdline_logging_info(caplog, capsys): | |
retv = tnefparse.cmdline.tnefparse(('-l', 'INFO', '-rb', 'tests/examples/rtf.tnef')) | |
assert not retv | |
stdout, _ = capsys.readouterr() | |
assert len(stdout) == 593 | |
assert caplog.record_tuples == [ | |
('tnefparse', logging.INFO, 'Skipping checksum for performance'), | |
] | |
def tnefparse(argv=None): | |
"command-line script" | |
if len(sys.argv) == 1: | |
parser.print_help() | |
sys.exit(1) | |
args = parser.parse_args(argv) | |
if args.logging: | |
logger.setLevel(getattr(logging, args.logging)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment