Ejemplo n.º 1
0
    def test_get_params__find_encoded_with_year(self):
        input_model = ('1', "?action=find&title=%5bRec%5d%202&year=2009")
        expected_output = {'handle': 1, 'action': 'find', 'title': "[Rec] 2", 'year': '2009'}

        actual_output = scraper_datahelper.get_params(input_model)

        self.assertDictEqual(expected_output, actual_output)
Ejemplo n.º 2
0
    def test_get_params__no_string(self):
        input_model = ('1')
        expected_output = {'handle': 1}

        actual_output = scraper_datahelper.get_params(input_model)

        self.assertDictEqual(expected_output, actual_output)
Ejemplo n.º 3
0
    def test_get_params__some_random_querystring(self):
        input_model = ('1', "?acorns=nested&fragile=Faces%20Around%20The%20World%202&howsit=elliot")
        expected_output = {'handle': 1, 'acorns': 'nested', 'fragile': "Faces Around The World 2",
            'howsit': 'elliot'}

        actual_output = scraper_datahelper.get_params(input_model)

        self.assertDictEqual(expected_output, actual_output)