def test_update_xray_env_variable_overwrite(self): os.environ = {"_X_AMZN_TRACE_ID": "old-id"} bootstrap.update_xray_env_variable("new-id") self.assertEqual(os.environ.get("_X_AMZN_TRACE_ID"), "new-id")
def test_update_xray_env_variable_remove_old_value(self): os.environ = {"_X_AMZN_TRACE_ID": "old-id"} bootstrap.update_xray_env_variable(None) self.assertEqual(os.environ.get("_X_AMZN_TRACE_ID"), None)
def test_update_xray_env_variable_new_value(self): os.environ = {} bootstrap.update_xray_env_variable("new-id") self.assertEqual(os.environ.get("_X_AMZN_TRACE_ID"), "new-id")
def test_update_xray_env_variable_empty(self): os.environ = {} bootstrap.update_xray_env_variable(None) self.assertEqual(os.environ.get("_X_AMZN_TRACE_ID"), None)