File: test_argparse.py

package info (click to toggle)
austin 3.7.0-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,444 kB
  • sloc: ansic: 8,622; python: 2,669; sh: 106; makefile: 54
file content (19 lines) | stat: -rw-r--r-- 402 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import test.cunit.argparse as argparse
from ctypes import c_char_p

import pytest


def parse_args(argv):
    argc = len(argv)
    return argparse.parse_args(argc, (c_char_p * argc)(*(_.encode() for _ in argv)))


def test_parse_args_command():
    assert parse_args(["austin", "python"])


# FIXME
@pytest.mark.exitcode(1)
def test_parse_args_process():
    assert parse_args(["austin", "-p", "123"])