<s> """<STR_LIT>""" <EOL> import sys <EOL> import os <EOL> import tempfile <EOL> import random <EOL> import csv <EOL> import optparse <EOL> import pytest <EOL> from pprint import pprint as pp <EOL> import test_tools <EOL> mod = test_tools . load_script ( '<STR_LIT>' ) <EOL> class TestOptsAndArgs ( object ) : <EOL> def _run_check ( self , sysarg , expected_result ) : <EOL> sys . argv = sysarg <EOL> cmd_parser = None <EOL> opts = None <EOL> files = None <EOL> if expected_result == '<STR_LIT>' : <EOL> with pytest . raises ( SystemExit ) : <EOL> cmd_parser = mod . CommandLineParser ( ) <EOL> opts = cmd_parser . opts <EOL> files = cmd_parser . files <EOL> elif expected_result == '<STR_LIT>' : <EOL> with pytest . raises ( Exception ) : <EOL> cmd_parser = mod . CommandLineParser ( ) <EOL> opts = cmd_parser . opts <EOL> files = cmd_parser . files <EOL> elif expected_result == '<STR_LIT>' : <EOL> try : <EOL> cmd_parser = mod . CommandLineParser ( ) <EOL> opts = cmd_parser . opts <EOL> files = cmd_parser . files <EOL> except : <EOL> pytest . fail ( '<STR_LIT>' ) <EOL> return cmd_parser , opts , files <EOL> def test_goaa_happy_path ( self ) : <EOL> parser , opts , files = self . _run_check ( [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:U+002C>' , '<STR_LIT>' , '<STR_LIT:|>' ] , '<STR_LIT>' ) <EOL> assert opts . output is None <EOL> assert opts . recdelimiter is None <EOL> assert opts . delimiter == '<STR_LIT:U+002C>' <EOL> assert opts . out_delimiter == '<STR_LIT:|>' <EOL> assert opts . recdelimiter is None <EOL> assert opts . out_recdelimiter is None <EOL> assert opts . quoting is False <EOL> assert opts . out_quoting is False <EOL> assert opts . quotechar == '<STR_LIT:">' <EOL> assert opts . hasheader is False <EOL> assert opts . out_hasheader is False <EOL> assert opts . stripfields is False <EOL> assert opts . verbose is True <EOL> self . _run_check ( [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:|>' ] , '<STR_LIT>' ) <EOL> self . _run_check ( [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:U+002C>' , '<STR_LIT>' , '<STR_LIT:|>' ] , '<STR_LIT>' ) <EOL> self . _run_check ( [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:U+002C>' , '<STR_LIT>' , '<STR_LIT:|>' , '<STR_LIT>' , '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> self . _run_check ( [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:|>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> self . _run_check ( [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:|>' , '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> def test_goaa_check_missing_out_del ( self ) : <EOL> self . _run_check ( [ '<STR_LIT>' , '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> def test_goaa_check_missing_out_del_arg ( self ) : <EOL> self . _run_check ( [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> def test_goaa_check_unknown_option ( self ) : <EOL> self . _run_check ( [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> def test_goaa_check_multi_file_no_options ( self ) : <EOL> self . _run_check ( [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , '<STR_LIT>' ) </s>
