code: def _test_upload(
      self,
      container: MetadataContainer,
      file_type: FileType,
      file_size: int,
  ):
      key = self.gen_key()
      extension = fake.file_extension()
      downloaded_filename = fake.file_name()
      content = os.urandom(file_size)
  
      if file_type is FileType.LOCAL_FILE:
          filename = fake.file_name(extension=extension)
          with open(filename, "wb") as file:
              file.write(content)
  
          file = File.from_path(filename)
      elif file_type is FileType.IN_MEMORY:
          file = File.from_content(content, extension=extension)
      elif file_type is FileType.STREAM:
          file = File.from_stream(
              io.BytesIO(content), extension=extension
          )
      else:
          raise ValueError()
  
      container[key].upload(file)
      container.sync()
      container[key].download(downloaded_filename)
  
      assert container[key].fetch_extension() == extension
      assert os.path.getsize(downloaded_filename) == file_size
      with open(downloaded_filename, "rb") as file:
          downloaded_content = file.read()
          assert len(content) == file_size
          assert downloaded_content == content
  
imports: import io
  import os
  import random
  import uuid
  from itertools import product
  from typing import Set
  from unittest.mock import Mock
  from zipfile import ZipFile
  import pytest
  from neptune.internal.backends import hosted_file_operations
  from neptune.internal.backends.api_model import MultipartConfig, OptionalFeatures
  from neptune.internal.backends.hosted_neptune_backend import HostedNeptuneBackend
  from neptune.internal.types.file_types import FileType
  from neptune.metadata_containers import MetadataContainer
  from neptune.types import File, FileSet
  from tests.e2e.base import AVAILABLE_CONTAINERS, BaseE2ETest, fake
  from tests.e2e.plot_utils import generate_altair_chart, generate_brokeh_figure, generate_matplotlib_figure, generate_pil_image, generate_plotly_figure, generate_seaborn_figure
  from tests.e2e.utils import SIZE_1KB, SIZE_1MB, initialize_container, preserve_cwd, tmp_context
label_desc: Use image node_id 2 for calling the TestUpload obj's underlying member method code with example usage: obj._test_upload(container, file_type, file_size) without return types