def METHOD_NAME(self, client: MLClient, randstr: Callable[[str], str]) -> None:
    with tempfile.TemporaryDirectory() as base_dir:
        # blob path is relative to the folder name of the code path.
        # to ensure that request url matches in playback mode, we need to guarantee that the folder name is the same
        source_dir = Path(base_dir, randstr("source_dir"))
        source_dir.mkdir()
        Path(source_dir, "file1.txt").write_text(randstr("content1"))
        Path(source_dir, "file2.txt").write_text(randstr("content2"))
        # code of the same content will be created only once, so we need to use name/version from created code
        code_entity = Code(name=randstr("name"), version="1", path=source_dir)
        created_code = client._code.create_or_update(code_entity)
        with tempfile.TemporaryDirectory() as target_dir:
            client._code.download(created_code.name, created_code.version, download_path=target_dir)
            assert Path(target_dir, "file1.txt").is_file()
            assert Path(target_dir, "file1.txt").read_text() == Path(source_dir, "file1.txt").read_text()
            assert Path(target_dir, "file2.txt").read_text() == Path(source_dir, "file2.txt").read_text()