def test_replace_env(self): """Test that Configuration._replace_env() correctly replaces $VAR entries""" input_dict = { 'REPLACE': '$VAR', 'EMPTY': '$EMPTY', 'KEEP': 'VAR', 'INTERLACED': '_ $VAR with other content' } output_dict = { 'REPLACE': 'value', 'EMPTY': '$EMPTY', 'KEEP': 'VAR', 'INTERLACED': '_ value with other content' } with mock.patch('os.environ', {'VAR': 'value'}): self.assertEqual(Configuration._replace_env(input_dict), output_dict)