def test_get_project_io(format_name: str, io_class: type[ProjectIoInterface]):
    """Get the right instance"""
    assert isinstance(get_project_io(format_name), io_class)
    assert get_project_io(format_name).format == format_name
def test_get_project_io_method():
    """Methods have the same code."""
    io = get_project_io("mock")
    result = get_project_io_method("mock", "load_model")

    assert result.__code__ == io.load_model.__code__
def test_set_project_plugin():
    """Set Change Plugin used for format foo"""
    assert isinstance(get_project_io("foo"), ProjectIoInterface)
    set_project_plugin("foo", "test_project_io_registration.MockProjectIo_bar")
    assert isinstance(get_project_io("foo"), MockProjectIo)