Exemple #1
0
    def it_sets_iconify_to_true_when_passed_as_an_arg(self):
        args = weathercli.Arguments().parse(['--iconify'])

        assert args['iconify'] == True
Exemple #2
0
    def it_can_output_its_help(self):
        args = weathercli.Arguments()

        assert args.help().startswith('usage')
Exemple #3
0
    def it_defaults_iconify_to_false(self):
        args = weathercli.Arguments().parse([])

        assert args['iconify'] == False
Exemple #4
0
    def it_gets_units_from_the_defaults(self):
        args = weathercli.Arguments().parse([], defaults={weathercli.Arguments.UNITS: 'celsius'})

        assert args['units'] == 'metric'
Exemple #5
0
    def it_defaults_unknown_units_to_imperial(self):
        args = weathercli.Arguments().parse([], defaults={weathercli.Arguments.UNITS: 'foo'})

        assert args['units'] == 'imperial'
Exemple #6
0
    def it_returns_the_units_passed_in(self):
        args = weathercli.Arguments().parse(['-u', 'celsius'])

        assert args['units'] == 'metric'
Exemple #7
0
    def it_defaults_units_to_imperial(self):
        args = weathercli.Arguments().parse([])

        assert args['units'] == 'imperial'
Exemple #8
0
    def it_gets_query_from_the_defaults(self):
        args = weathercli.Arguments().parse([], defaults={weathercli.Arguments.QUERY: 'foo'})

        assert args['query'] == 'foo'
Exemple #9
0
    def it_returns_a_query_passed_in(self):
        args = weathercli.Arguments().parse(['foo'])

        assert args['query'] == 'foo'
Exemple #10
0
    def it_returns_None_if_no_query_given(self):
        args = weathercli.Arguments().parse([])

        assert args['query'] == None