def test_val_is_not_present_in_env_config___param_from_the_root_context_is_returned( self, key, val, env): ctx = EnvContext({ key: val, 'env': env, 'envs': { key + 'extra': val + 'extra' }, }) self.assertEqual(ctx.get(key), val)
def test_val_is_present_in_env_config___param_from_the_env_context_is_returned( self, key, val, env, env_val): ctx = EnvContext({ key: val, 'env': env, 'envs': { env: { key: env_val } }, }) self.assertEqual(ctx.get(key), env_val)
def test_env_is_not_present_in_the_context_no_default_is_set___none_is_returned( self, key, val): ctx = EnvContext({key + 'extra': val}) self.assertIsNone(ctx.get(key))
def test_env_is_not_present_in_the_context___param_from_the_root_context_is_returned( self, key, val): ctx = EnvContext({key: val}) self.assertEqual(ctx.get(key), val)
def test_env_is_not_present_in_the_context_default_is_set___default_is_returned( self, key, val, default): ctx = EnvContext({key + 'extra': val}) self.assertEqual(ctx.get(key, default), default)