Exemplo n.º 1
0
 def test_sanitize_components_one_element(self):
     '''
     Tests a single component to be sanitized.
     '''
     mock_component_list = ['foo=bar', 'api_key=abcdefghijklmnop']
     mock_ret = 'foo=bar&api_key=XXXXXXXXXX&'
     ret = http._sanitize_url_components(mock_component_list, 'api_key')
     self.assertEqual(ret, mock_ret)
Exemplo n.º 2
0
 def test_sanitize_components_multiple_elements(self):
     '''
     Tests two componenets to be sanitized.
     '''
     mock_component_list = ['foo=bar', 'foo=baz', 'api_key=testing']
     mock_ret = 'foo=XXXXXXXXXX&foo=XXXXXXXXXX&api_key=testing&'
     ret = http._sanitize_url_components(mock_component_list, 'foo')
     self.assertEqual(ret, mock_ret)
Exemplo n.º 3
0
 def test_sanitize_components_multiple_elements(self):
     """
     Tests two componenets to be sanitized.
     """
     mock_component_list = ["foo=bar", "foo=baz", "api_key=testing"]
     mock_ret = "foo=XXXXXXXXXX&foo=XXXXXXXXXX&api_key=testing&"
     ret = http._sanitize_url_components(mock_component_list, "foo")
     self.assertEqual(ret, mock_ret)
Exemplo n.º 4
0
 def test_sanitize_components_no_elements(self):
     '''
     Tests when zero elements need to be sanitized.
     '''
     mock_component_list = ['foo=bar', 'bar=baz', 'hello=world']
     mock_ret = 'foo=bar&bar=baz&hello=world&'
     ret = http._sanitize_url_components(mock_component_list, 'api_key')
     self.assertEqual(ret, mock_ret)
Exemplo n.º 5
0
 def test_sanitize_components_one_element(self):
     """
     Tests a single component to be sanitized.
     """
     mock_component_list = ["foo=bar", "api_key=abcdefghijklmnop"]
     mock_ret = "foo=bar&api_key=XXXXXXXXXX&"
     ret = http._sanitize_url_components(mock_component_list, "api_key")
     self.assertEqual(ret, mock_ret)
Exemplo n.º 6
0
 def test_sanitize_components_no_elements(self):
     """
     Tests when zero elements need to be sanitized.
     """
     mock_component_list = ["foo=bar", "bar=baz", "hello=world"]
     mock_ret = "foo=bar&bar=baz&hello=world&"
     ret = http._sanitize_url_components(mock_component_list, "api_key")
     self.assertEqual(ret, mock_ret)
Exemplo n.º 7
0
 def test_sanitize_components_multiple_elements(self):
     '''
     Tests two componenets to be sanitized.
     '''
     mock_component_list = ['foo=bar', 'foo=baz', 'api_key=testing']
     mock_ret = 'foo=XXXXXXXXXX&foo=XXXXXXXXXX&api_key=testing&'
     ret = http._sanitize_url_components(mock_component_list, 'foo')
     self.assertEqual(ret, mock_ret)
Exemplo n.º 8
0
 def test_sanitize_components_one_element(self):
     '''
     Tests a single component to be sanitized.
     '''
     mock_component_list = ['foo=bar', 'api_key=abcdefghijklmnop']
     mock_ret = 'foo=bar&api_key=XXXXXXXXXX&'
     ret = http._sanitize_url_components(mock_component_list, 'api_key')
     self.assertEqual(ret, mock_ret)
Exemplo n.º 9
0
 def test_sanitize_components_no_elements(self):
     '''
     Tests when zero elements need to be sanitized.
     '''
     mock_component_list = ['foo=bar', 'bar=baz', 'hello=world']
     mock_ret = 'foo=bar&bar=baz&hello=world&'
     ret = http._sanitize_url_components(mock_component_list, 'api_key')
     self.assertEqual(ret, mock_ret)