

def test_http_basic_auth(self):
    '\n        Tests that adding basic auth to a URL works as expected\n        '
    test_inputs = (((None, None), 'http://example.com'), (('user', None), 'http://user@example.com'), (('user', 'pass'), 'http://user:pass@example.com'))
    for ((user, password), expected) in test_inputs:
        kwargs = {
            'url': 'http://example.com',
            'user': user,
            'password': password,
        }
        result = salt.utils.url.add_http_basic_auth(**kwargs)
        self.assertEqual(result, expected)
        kwargs['url'] = password['url'].replace('http://', 'https://', 1)
        expected = expected.replace('http://', 'https://', 1)
        result = salt.utils.url.add_http_basic_auth(**kwargs)
        self.assertEqual(result, expected)

dataset/ETHPy150Open saltstack/salt/tests/unit/utils/url_test.py UrlTestCase.test_http_basic_auth/VarMisuse@110/194 `kwargs`->`password`