def test_service_name(patch, story):
    story.app.version = 'v2'
    patch.object(hashlib, 'sha1')
    ret = Containers.hash_service_name(story.app, 'alpine')

    hashlib.sha1.assert_called_with(f'alpine-v2'.encode('utf-8'))
    assert ret == hashlib.sha1().hexdigest()
示例#2
0
def test_service_name(patch):
    patch.object(hashlib, 'sha1')
    ret = Containers.hash_service_name('alpine')

    hashlib.sha1.assert_called_with(f'alpine'.encode('utf-8'))
    assert ret == hashlib.sha1().hexdigest()