def METHOD_NAME(self, client: MLClient, code_asset_path: str, randstr: Callable[[str], str]) -> None:
    code_entity = Code(name=randstr("name"), version="1", path=code_asset_path)
    # code of the same content will be created only once, so we need to use name/version from created code
    created_code = client._code.create_or_update(code_entity)
    with tempfile.TemporaryDirectory() as temp_dir:
        client._code.download(created_code.name, created_code.version, download_path=temp_dir)
        assert Path(temp_dir, "code.txt").is_file()
        assert Path(temp_dir, "code.txt").read_text() == Path(code_asset_path).read_text()