diff --git a/python/test/unit/spacewalk/satellite_tools/test_reposync.py b/python/test/unit/spacewalk/satellite_tools/test_reposync.py index acd7ce9cc851..5a60960c9a9c 100644 --- a/python/test/unit/spacewalk/satellite_tools/test_reposync.py +++ b/python/test/unit/spacewalk/satellite_tools/test_reposync.py @@ -634,7 +634,7 @@ def test_set_repo_credentials_number_credentials(self): "http://example.com/?credentials=testcreds_42" ] } - _mock_rhnsql(self.reposync, [{ 'username' : 'foo', 'password': 'c2VjcmV0' , 'extra_auth': memoryview(b'{\"my_header\": \"my_value\"}')}]) + _mock_rhnsql(self.reposync, [{ 'username' : 'foo', 'password': 'c2VjcmV0', 'type': 'cloudrmt', 'extra_auth': memoryview(b'{\"my_header\": \"my_value\"}')}]) self.assertEqual( rs.set_repo_credentials(url), [{"url":"http://foo:secret@example.com/", "http_headers": {"my_header": "my_value"}}]) @@ -776,7 +776,8 @@ def test__url_with_repo_credentials(self): config = { 'return_value.fetchone_dict.return_value': { "username": "user#1", - "password": base64.encodestring(password.encode()).decode() + "password": base64.encodestring(password.encode()).decode(), + "type": "SCC" } } patcher = patch( @@ -788,7 +789,7 @@ def test__url_with_repo_credentials(self): {"url": 'http://{0}:{1}@some.url'.format(username, password), "http_headers": {}} ) mock_prepare.assert_called_once_with( - 'SELECT username, password, extra_auth FROM suseCredentials WHERE id = :id' + '\n SELECT c.username, c.password, c.extra_auth, ct.label type\n FROM suseCredentials c\n JOIN suseCredentialsType ct on c.type_id = ct.id\n WHERE c.id = :id\n ' ) mock_prepare().execute.assert_called_once_with(id=credentials_id)