- def test_env_get(self):
- def f(comp_self):
- return comp_self._create_trace_class(env={'hello': 'you', 'foo': -5})
-
- tc = run_in_component_init(f)
-
- self.assertEqual(tc.env['hello'], 'you')
- self.assertEqual(tc.env['foo'], -5)
-
- def test_env_get_non_existent(self):
- def f(comp_self):
- return comp_self._create_trace_class(env={'hello': 'you', 'foo': -5})
-
- tc = run_in_component_init(f)
-
- with self.assertRaises(KeyError):
- tc.env['lel']
-