def test_default_params_values(self):
        "params should always be alphabetized, and end with format and limit"
        params = [
            ('start_date=', '2012-11-02'),
            ('end_date=',   '2012-11-02'),
        ]
        unordered = OrderedDict(params)

        ordered = params[:]
        ordered.sort()
        ordered.extend([('format', 'json'), ('limit', '0')])
        expected = OrderedDict(ordered)

        actual = prepare_api_params(unordered)
        self.assertEquals(expected, actual)
Beispiel #2
0
    def test_default_params_values(self):
        "params should always be alphabetized, and end with format and limit"
        params = [
            ('start_date=', '2012-11-02'),
            ('end_date=', '2012-11-02'),
        ]
        unordered = OrderedDict(params)

        ordered = params[:]
        ordered.sort()
        ordered.extend([('format', 'json'), ('limit', '0')])
        expected = OrderedDict(ordered)

        actual = prepare_api_params(unordered)
        self.assertEquals(expected, actual)
 def test_default_params(self):
     "default params should include format and limit"
     expected = OrderedDict([('format', 'json'), ('limit', '0')])
     actual = prepare_api_params({})
     self.assertEquals(expected, actual)
Beispiel #4
0
 def test_default_params(self):
     "default params should include format and limit"
     expected = OrderedDict([('format', 'json'), ('limit', '0')])
     actual = prepare_api_params({})
     self.assertEquals(expected, actual)