Ejemplo n.º 1
0
 def test_query_private_engine_without_token(self):
     preferences = Preferences(['oscar'], ['general'], engines, [])
     valid, unknown, invalid_token = validate_engineref_list(
         SEARCHQUERY, preferences)
     self.assertEqual(len(valid), 0)
     self.assertEqual(len(unknown), 0)
     self.assertEqual(len(invalid_token), 1)
Ejemplo n.º 2
0
 def test_query_private_engine_with_correct_token(self):
     preferences_with_tokens = Preferences(['oscar'], ['general'], engines, [])
     preferences_with_tokens.parse_dict({'tokens': 'my-token'})
     valid, unknown, invalid_token = validate_engineref_list(SEARCHQUERY, preferences_with_tokens)
     self.assertEqual(len(valid), 1)
     self.assertEqual(len(unknown), 0)
     self.assertEqual(len(invalid_token), 0)