def test_create_model_modify_node():
    modifier = renamed_params.SessionCreateModelImageURIRenamer()

    for template in CREATE_MODEL_TEMPLATES:
        call = ast_call(template.format("primary_container_image=my_image"))
        modifier.modify_node(call)

        expected = template.format("image_uri=my_image")
        assert expected == pasta.dump(call)
def test_create_model_node_should_be_modified_random_function_call():
    modifier = renamed_params.SessionCreateModelImageURIRenamer()
    assert not modifier.node_should_be_modified(ast_call("create_model()"))
def test_create_model_node_should_be_modified_no_image():
    modifier = renamed_params.SessionCreateModelImageURIRenamer()

    for template in CREATE_MODEL_TEMPLATES:
        call = ast_call(template.format(""))
        assert not modifier.node_should_be_modified(call)