Merge "Update test_deploy_storlet expectations to be bytes"

This commit is contained in:
Zuul 2019-11-13 02:45:05 +00:00 committed by Gerrit Code Review
commit b0c939fe24
3 changed files with 27 additions and 27 deletions

@ -34,7 +34,7 @@ class DeployTestMixin(object):
resp_headers = swiftclient.client.head_object(
url, token, container, expected_file)
hasher = hashlib.md5()
with open(file_path) as f:
with open(file_path, 'rb') as f:
hasher.update(f.read())
self.assertEqual(resp_headers['etag'], hasher.hexdigest())

@ -36,20 +36,20 @@ class TestDeployStorlet(DeployTestMixin, StorletBaseFunctionalTest):
'get42')
self.scenario = [
('Enter storlet language (java or python): ', EXPECT),
('java', SEND_LINE),
('Enter absolute path to storlet jar file: ', EXPECT),
(self.execdep_storlet_file, SEND_LINE),
('Your jar file contains the following classes:', EXPECT),
('\t* org.openstack.storlet.execdep.ExecDepStorlet', EXPECT),
('Please enter fully qualified storlet main class '
'(choose from the list above): ', EXPECT),
('org.openstack.storlet.execdep.ExecDepStorlet', SEND_LINE),
('Please enter dependency files '
'(leave a blank line when you are done): ', EXPECT),
(self.execdep_storlet_dep_file, SEND_LINE),
('', SEND_LINE), # DO NOT send \n but just empty due to sendline
('Storlet deployment complete', EXPECT),
(b'Enter storlet language (java or python): ', EXPECT),
(b'java', SEND_LINE),
(b'Enter absolute path to storlet jar file: ', EXPECT),
(self.execdep_storlet_file.encode('ascii'), SEND_LINE),
(b'Your jar file contains the following classes:', EXPECT),
(b'\t* org.openstack.storlet.execdep.ExecDepStorlet', EXPECT),
(b'Please enter fully qualified storlet main class '
b'(choose from the list above): ', EXPECT),
(b'org.openstack.storlet.execdep.ExecDepStorlet', SEND_LINE),
(b'Please enter dependency files '
b'(leave a blank line when you are done): ', EXPECT),
(self.execdep_storlet_dep_file.encode('ascii'), SEND_LINE),
(b'', SEND_LINE), # DO NOT send \n but just empty due to sendline
(b'Storlet deployment complete', EXPECT),
]

@ -34,18 +34,18 @@ class TestDeployStorlet(DeployTestMixin, StorletBaseFunctionalTest):
'get42.sh')
self.scenario = [
('Enter storlet language (java or python): ', EXPECT),
('python', SEND_LINE),
('Enter absolute path to storlet file: ', EXPECT),
(self.execdep_storlet_file, SEND_LINE),
('Please enter fully qualified storlet main class '
'<filename.ClassName>: ', EXPECT),
('exec_dep.ExecDepStorlet', SEND_LINE),
('Please enter dependency files '
'(leave a blank line when you are done): ', EXPECT),
(self.execdep_storlet_dep_file, SEND_LINE),
('', SEND_LINE), # DO NOT send \n but just empty due to sendline
('Storlet deployment complete', EXPECT),
(b'Enter storlet language (java or python): ', EXPECT),
(b'python', SEND_LINE),
(b'Enter absolute path to storlet file: ', EXPECT),
(self.execdep_storlet_file.encode('ascii'), SEND_LINE),
(b'Please enter fully qualified storlet main class '
b'<filename.ClassName>: ', EXPECT),
(b'exec_dep.ExecDepStorlet', SEND_LINE),
(b'Please enter dependency files '
b'(leave a blank line when you are done): ', EXPECT),
(self.execdep_storlet_dep_file.encode('ascii'), SEND_LINE),
(b'', SEND_LINE), # DO NOT send \n but just empty due to sendline
(b'Storlet deployment complete', EXPECT),
]