def test__extract_files(load_mock): id = _core_identifier.Identifier(_core_identifier.ResourceType.UNSPECIFIED, 'myproject', 'development', 'name', 'v') load_mock.return_value = id.to_flyte_idl() with pytest.raises(FlyteAssertion): _main._extract_pair('a', 'b')
def test__extract_files_with_unspecified_resource_type(load_mock): id = _core_identifier.Identifier( _core_identifier.ResourceType.UNSPECIFIED, "myproject", "development", "name", "v", ) load_mock.return_value = id.to_flyte_idl() with pytest.raises(FlyteAssertion): _main._extract_pair("a", "b")
def test__extract_files(load_mock): id = _core_identifier.Identifier(_core_identifier.ResourceType.TASK, "myproject", "development", "name", "v") t = get_sample_task() with TemporaryConfiguration( "", internal_overrides={"image": "myflyteimage:v123", "project": "myflyteproject", "domain": "development"}, ): task_spec = t.serialize() load_mock.side_effect = [id.to_flyte_idl(), task_spec] new_id, entity = _main._extract_pair("a", "b") assert new_id == id.to_flyte_idl() assert task_spec == entity
def test__extract_files(load_mock): id = _core_identifier.Identifier(_core_identifier.ResourceType.TASK, 'myproject', 'development', 'name', 'v') t = get_sample_task() with TemporaryConfiguration("", internal_overrides={ 'image': 'myflyteimage:v123', 'project': 'myflyteproject', 'domain': 'development' }): task_spec = t.serialize() load_mock.side_effect = [id.to_flyte_idl(), task_spec] new_id, entity = _main._extract_pair('a', 'b') assert new_id == id.to_flyte_idl() assert task_spec == entity