Example #1
0
 def test_having_port(self):
     """basic auth creds correctly stripped from URL containing creds even if URL
     contains port"""
     url = 'https://*****:*****@domain.com:8080/project/objects.inv'
     expected = 'https://domain.com:8080/project/objects.inv'
     actual = _strip_basic_auth(url)
     self.assertEqual(expected, actual)
Example #2
0
 def test_having_port(self):
     """basic auth creds correctly stripped from URL containing creds even if URL
     contains port"""
     url = 'https://*****:*****@domain.com:8080/project/objects.inv'
     expected = 'https://domain.com:8080/project/objects.inv'
     actual = _strip_basic_auth(url)
     self.assertEqual(expected, actual)
Example #3
0
 def test_no_auth(self):
     """url unchanged if param doesn't contain basic auth creds"""
     url = "https://domain.com/project/objects.inv"
     expected = "https://domain.com/project/objects.inv"
     actual_url, actual_username, actual_password = _strip_basic_auth(url)
     self.assertEqual(expected, actual_url)
     self.assertEqual(None, actual_username)
     self.assertEqual(None, actual_password)
Example #4
0
 def test_auth_stripped(self):
     """basic auth creds stripped from URL containing creds"""
     url = "https://*****:*****@domain.com/project/objects.inv"
     expected = "https://domain.com/project/objects.inv"
     actual_url, actual_username, actual_password = _strip_basic_auth(url)
     self.assertEqual(expected, actual_url)
     self.assertEqual("user", actual_username)
     self.assertEqual("12345", actual_password)
Example #5
0
 def test_no_auth(self):
     """url unchanged if param doesn't contain basic auth creds"""
     url = 'https://domain.com/project/objects.inv'
     expected = 'https://domain.com/project/objects.inv'
     actual_url, actual_username, actual_password = _strip_basic_auth(url)
     self.assertEqual(expected, actual_url)
     self.assertEqual(None, actual_username)
     self.assertEqual(None, actual_password)
Example #6
0
 def test_auth_stripped(self):
     """basic auth creds stripped from URL containing creds"""
     url = 'https://*****:*****@domain.com/project/objects.inv'
     expected = 'https://domain.com/project/objects.inv'
     actual_url, actual_username, actual_password = _strip_basic_auth(url)
     self.assertEqual(expected, actual_url)
     self.assertEqual('user', actual_username)
     self.assertEqual('12345', actual_password)
Example #7
0
 def test_no_auth(self):
     """url unchanged if param doesn't contain basic auth creds"""
     url = 'https://domain.com/project/objects.inv'
     expected = 'https://domain.com/project/objects.inv'
     actual = _strip_basic_auth(url)
     self.assertEqual(expected, actual)
Example #8
0
 def test_auth_stripped(self):
     """basic auth creds stripped from URL containing creds"""
     url = 'https://*****:*****@domain.com/project/objects.inv'
     expected = 'https://domain.com/project/objects.inv'
     actual = _strip_basic_auth(url)
     self.assertEqual(expected, actual)