def test_create_endpoint_modify_node(): modifier = renamed_params.SessionCreateEndpointImageURIRenamer() for template in CREATE_ENDPOINT_TEMPLATES: call = ast_call(template.format("deployment_image=my_image")) modifier.modify_node(call) expected = template.format("image_uri=my_image") assert expected == pasta.dump(call)
def test_create_endpoint_node_should_be_modified_random_function_call(): modifier = renamed_params.SessionCreateEndpointImageURIRenamer() assert not modifier.node_should_be_modified(ast_call("create_endpoint()"))
def test_create_endpoint_node_should_be_modified_no_image(): modifier = renamed_params.SessionCreateEndpointImageURIRenamer() for template in CREATE_ENDPOINT_TEMPLATES: call = ast_call(template.format("")) assert not modifier.node_should_be_modified(call)