summaryrefslogtreecommitdiff
path: root/scripts/emit_releases_file/test_get_dlrn_hash.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/emit_releases_file/test_get_dlrn_hash.py')
-rw-r--r--scripts/emit_releases_file/test_get_dlrn_hash.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/scripts/emit_releases_file/test_get_dlrn_hash.py b/scripts/emit_releases_file/test_get_dlrn_hash.py
index 2525fb1..d94cf7c 100644
--- a/scripts/emit_releases_file/test_get_dlrn_hash.py
+++ b/scripts/emit_releases_file/test_get_dlrn_hash.py
@@ -7,18 +7,20 @@ import pytest
7@mock.patch('requests.get') 7@mock.patch('requests.get')
8def test_get_dlrn_hash(mock_get): 8def test_get_dlrn_hash(mock_get):
9 mock_response = mock.Mock() 9 mock_response = mock.Mock()
10 mock_response.content = ('[delorean]\nname=delorean-openstack-nova-81c23c04' 10 mock_response.content = (
11 '7e8e0fc03b54164921f49fdb4103202c\nbaseurl=https:/' 11 '[delorean]\nname=delorean-openstack-nova-81c23c04'
12 '/trunk.rdoproject.org/centos7/81/c2/81c23c047e8e0' 12 '7e8e0fc03b54164921f49fdb4103202c\nbaseurl=https:/'
13 'fc03b54164921f49fdb4103202c_b333f915\nenabled=1\n' 13 '/trunk.rdoproject.org/centos7/81/c2/81c23c047e8e0'
14 'gpgcheck=0\npriority=1') 14 'fc03b54164921f49fdb4103202c_b333f915\nenabled=1\n'
15 'gpgcheck=0\npriority=1')
15 release = 'master' 16 release = 'master'
16 hash_name = 'current-tripleo' 17 hash_name = 'current-tripleo'
17 repo_url = ('https://trunk.rdoproject.org/centos7-%s/%s/delorean.repo' 18 repo_url = ('https://trunk.rdoproject.org/centos7-%s/%s/delorean.repo' %
18 % (release, hash_name)) 19 (release, hash_name))
19 mock_get.return_value = mock_response 20 mock_get.return_value = mock_response
20 assert (get_dlrn_hash(release, hash_name) == 21 assert (get_dlrn_hash(
21 '81c23c047e8e0fc03b54164921f49fdb4103202c_b333f915') 22 release,
23 hash_name) == '81c23c047e8e0fc03b54164921f49fdb4103202c_b333f915')
22 mock_get.assert_called_once_with(repo_url, timeout=(3.05, 27)) 24 mock_get.assert_called_once_with(repo_url, timeout=(3.05, 27))
23 25
24 26