hunk.code_window: DIST_PATH = Path(__file__).parent.parent / "fixtures" / "distributions"
   def test_file_dependency():
       dependency = FileDependency("demo", DIST_PATH / "demo-0.1.0.tar.gz")
       assert dependency.pretty_name == "demo"
       assert dependency.path == DIST_PATH / "demo-0.1.0.tar.gz"
       assert dependency.base_pep_508_name == "demo @ {}".format(
           DIST_PATH / "demo-0.1.0.tar.gz"
       )
   def test_file_dependency_wrong_path():
       with pytest.raises(ValueError):
           FileDependency("demo", DIST_PATH / "demo-0.2.0.tar.gz")
  
hunk.labels: keep keep keep replace replace replace replace replace replace replace replace replace replace keep keep keep keep
hunk.file_path: tests/packages/test_file_dependency.py
hunk.type: replace
file: from typing import Any
  from typing import Dict
  
  from .config_source import ConfigSource
  
  
  class DictConfigSource(ConfigSource):
      def __init__(self):  # type: () -> None
          self._config = {}
  
      @property
      def config(self):  # type: () -> Dict[str, Any]
          return self._config
  
      def add_property(self, key, value):  # type: (str, Any) -> None
          keys = key.split(".")
          config = self._config
  
          for i, key in enumerate(keys):
              if key not in config and i < len(keys) - 1:
                  config[key] = {}
  
              if i == len(keys) - 1:
                  config[key] = value
                  break
  
              config = config[key]
  
      def remove_property(self, key):  # type: (str) -> None
          keys = key.split(".")
  
          config = self._config
          for i, key in enumerate(keys):
              if key not in config:
                  return
  
              if i == len(keys) - 1:
                  del config[key]
  
                  break
  
              config = config[key]
  