@@ -25,6 +25,7 @@ def test_can_get_config_from_environment(monkeypatch):
25
25
namespace = fake .word ()
26
26
disable_metric_extraction = True
27
27
environment_override = fake .word ()
28
+ only_log_events_with_metrics = True
28
29
29
30
monkeypatch .setenv ("AWS_EMF_ENABLE_DEBUG_LOGGING" , str (debug_enabled ))
30
31
monkeypatch .setenv ("AWS_EMF_SERVICE_NAME" , service_name )
@@ -36,6 +37,7 @@ def test_can_get_config_from_environment(monkeypatch):
36
37
monkeypatch .setenv ("AWS_EMF_NAMESPACE" , namespace )
37
38
monkeypatch .setenv ("AWS_EMF_DISABLE_METRIC_EXTRACTION" , str (disable_metric_extraction ))
38
39
monkeypatch .setenv ("AWS_EMF_ENVIRONMENT" , environment_override )
40
+ monkeypatch .setenv ("AWS_EMF_ONLY_LOG_EVENTS_WITH_METRICS" , only_log_events_with_metrics )
39
41
40
42
# act
41
43
result = get_config ()
@@ -51,6 +53,7 @@ def test_can_get_config_from_environment(monkeypatch):
51
53
assert result .namespace == namespace
52
54
assert result .disable_metric_extraction == disable_metric_extraction
53
55
assert result .environment == environment_override
56
+ assert result .only_log_events_with_metrics == only_log_events_with_metrics
54
57
55
58
56
59
def test_can_override_config (monkeypatch ):
@@ -65,6 +68,7 @@ def test_can_override_config(monkeypatch):
65
68
monkeypatch .setenv ("AWS_EMF_NAMESPACE" , fake .word ())
66
69
monkeypatch .setenv ("AWS_EMF_DISABLE_METRIC_EXTRACTION" , str (True ))
67
70
monkeypatch .setenv ("AWS_EMF_ENVIRONMENT" , fake .word ())
71
+ monkeypatch .setenv ("AWS_EMF_ONLY_LOG_EVENTS_WITH_METRICS" , str (True ))
68
72
69
73
config = get_config ()
70
74
@@ -78,6 +82,7 @@ def test_can_override_config(monkeypatch):
78
82
namespace = fake .word ()
79
83
disable_metric_extraction = False
80
84
environment = fake .word ()
85
+ only_log_events_with_metrics = False
81
86
82
87
# act
83
88
config .debug_logging_enabled = debug_enabled
@@ -90,6 +95,7 @@ def test_can_override_config(monkeypatch):
90
95
config .namespace = namespace
91
96
config .disable_metric_extraction = disable_metric_extraction
92
97
config .environment = environment
98
+ config .only_log_events_with_metrics = only_log_events_with_metrics
93
99
94
100
# assert
95
101
assert config .debug_logging_enabled == debug_enabled
@@ -102,3 +108,4 @@ def test_can_override_config(monkeypatch):
102
108
assert config .namespace == namespace
103
109
assert config .disable_metric_extraction == disable_metric_extraction
104
110
assert config .environment == environment
111
+ assert config .only_log_events_with_metrics == only_log_events_with_metrics
0 commit comments