def METHOD_NAME(self):
    """Test getting dependencies on defines and substs."""
    env = PartialConfigEnvironment(self._objdir())
    env.write_vars(config)
    self._assert_deps(env, [])
    self.assertEqual(env.defines["MOZ_FOO"], "1")
    self._assert_deps(env, ["defines/MOZ_FOO"])
    self.assertEqual(env.defines["MOZ_BAR"], "2")
    self._assert_deps(env, ["defines/MOZ_FOO", "defines/MOZ_BAR"])
    # Getting a define again shouldn't add a redundant dependency
    self.assertEqual(env.defines["MOZ_FOO"], "1")
    self._assert_deps(env, ["defines/MOZ_FOO", "defines/MOZ_BAR"])
    self.assertEqual(env.substs["MOZ_SUBST_1"], "1")
    self._assert_deps(
        env, ["defines/MOZ_FOO", "defines/MOZ_BAR", "substs/MOZ_SUBST_1"]
    )
    with self.assertRaises(KeyError):
        _ = env.substs["NON_EXISTENT"]
    self._assert_deps(
        env,
        [
            "defines/MOZ_FOO",
            "defines/MOZ_BAR",
            "substs/MOZ_SUBST_1",
            "substs/NON_EXISTENT",
        ],
    )
    self.assertEqual(env.substs.get("NON_EXISTENT"), None)