예제 #1
0
def test_get_container_name(patch, story, line, reusable):
    patch.object(Containers, 'is_service_reusable', return_value=reusable)
    story.app.app_id = 'my_app'
    ret = Containers.get_container_name(story, line, 'alpine')
    if reusable:
        assert ret == 'asyncy--my_app-alpine-1'
    else:
        h = Containers.hash_story_line(story, line)
        assert ret == f'asyncy--{story.app.app_id}-{h}-1'
예제 #2
0
def test_get_container_name(patch, story, line, reusable):
    patch.object(Containers, 'is_service_reusable', return_value=reusable)
    story.app.app_id = 'my_app'
    ret = Containers.get_container_name(story, line, 'alpine')
    if reusable:
        assert ret == f'alpine-{Containers.hash_service_name("alpine")}'
    else:
        h = Containers.hash_service_name_and_story_line(story, line, 'alpine')
        assert ret == f'alpine-{h}'