def test_filter_query_string_by_key_prefix_all_three(self):
     query_string = "age_year=28&age_month=10&weight=60"
     computed = _filter_query_string_by_key_prefix(query_string, include_prefixes=["a", "weight"])
     expected_items = ["age_year=28", "age_month=10", "weight=60"]
     self.assertEqual(len(computed.split("&")), 3)
     for item in expected_items:
         self.assertIn(item, computed)
Esempio n. 2
0
 def test_filter_query_string_by_key_prefix_all_three(self):
     query_string = "age_year=28&age_month=10&weight=60"
     computed = _filter_query_string_by_key_prefix(
         query_string, include_prefixes=["a", "weight"])
     expected_items = ["age_year=28", "age_month=10", "weight=60"]
     self.assertEqual(len(computed.split("&")), 3)
     for item in expected_items:
         self.assertIn(item, computed)
Esempio n. 3
0
 def test_filter_query_string_by_key_prefix_all_two(self):
     query_string = "age=28&weight=60"
     computed = _filter_query_string_by_key_prefix(
         query_string, include_prefixes=["a", "weight"])
     expected_items = {"age": ["28"], "weight": ["60"]}
     self.assertQueryStringArgsEqual(computed, expected_items)
Esempio n. 4
0
 def test_filter_query_string_by_key_prefix_one_of_two(self):
     query_string = "age=28&weight=60"
     computed = _filter_query_string_by_key_prefix(query_string,
                                                   include_prefixes=["a"])
     expected = "age=28"
     self.assertEqual(computed, expected)
Esempio n. 5
0
 def test_filter_query_string_by_key_prefix_return_empty(self):
     query_string = "age=28&weight=60"
     computed = _filter_query_string_by_key_prefix(query_string,
                                                   include_prefixes=[])
     expected = ""
     self.assertEqual(computed, expected)
 def test_filter_query_string_by_key_prefix_all_two(self):
     query_string = "age=28&weight=60"
     computed = _filter_query_string_by_key_prefix(query_string, include_prefixes=["a", "weight"])
     expected_items = {"age": ["28"], "weight": ["60"]}
     self.assertQueryStringArgsEqual(computed, expected_items)
 def test_filter_query_string_by_key_prefix_one_of_two(self):
     query_string = "age=28&weight=60"
     computed = _filter_query_string_by_key_prefix(query_string, include_prefixes=["a"])
     expected = "age=28"
     self.assertEqual(computed, expected)
 def test_filter_query_string_by_key_prefix_return_empty(self):
     query_string = "age=28&weight=60"
     computed = _filter_query_string_by_key_prefix(query_string, include_prefixes=[])
     expected = ""
     self.assertEqual(computed, expected)