-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
4 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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:[email protected]/", "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) | ||
|
||
|