def it_sets_iconify_to_true_when_passed_as_an_arg(self): args = weathercli.Arguments().parse(['--iconify']) assert args['iconify'] == True
def it_can_output_its_help(self): args = weathercli.Arguments() assert args.help().startswith('usage')
def it_defaults_iconify_to_false(self): args = weathercli.Arguments().parse([]) assert args['iconify'] == False
def it_gets_units_from_the_defaults(self): args = weathercli.Arguments().parse([], defaults={weathercli.Arguments.UNITS: 'celsius'}) assert args['units'] == 'metric'
def it_defaults_unknown_units_to_imperial(self): args = weathercli.Arguments().parse([], defaults={weathercli.Arguments.UNITS: 'foo'}) assert args['units'] == 'imperial'
def it_returns_the_units_passed_in(self): args = weathercli.Arguments().parse(['-u', 'celsius']) assert args['units'] == 'metric'
def it_defaults_units_to_imperial(self): args = weathercli.Arguments().parse([]) assert args['units'] == 'imperial'
def it_gets_query_from_the_defaults(self): args = weathercli.Arguments().parse([], defaults={weathercli.Arguments.QUERY: 'foo'}) assert args['query'] == 'foo'
def it_returns_a_query_passed_in(self): args = weathercli.Arguments().parse(['foo']) assert args['query'] == 'foo'
def it_returns_None_if_no_query_given(self): args = weathercli.Arguments().parse([]) assert args['query'] == None