def test_binary_hook_sequence_is_lower_than_030(
self, write_cloud_config_in_memory, monkeypatch):
# That's the lowest sequence of disks and we want to filter before that
filter_template = '-- binary hook filter:{} --'
hook_filter = 'some*glob'
monkeypatch.setattr(
generate_build_config,
"BINARY_HOOK_FILTER_CONTENT", filter_template)
output = write_cloud_config_in_memory(binary_hook_filter=hook_filter)
cloud_config = yaml.load(output)
expected_content = filter_template.format(hook_filter)
for stanza in cloud_config['write_files']:
content = base64.b64decode(stanza['content']).decode('utf-8')
if content == expected_content:
break
else:
pytest.fail('Binary hook filter not correctly included.')
path = stanza['path'].rsplit('/')[-1]
assert path < '030-some-file.binary'
评论列表
文章目录