@@ -479,12 +479,13 @@ def test_consumer_group_env(self):
479
479
"""
480
480
Sanity check consumer_group gets set from the environment via getenv.
481
481
"""
482
- consumer_group = "my_group"
483
- with patch .dict (os .environ , {"Quix__Consumer__group" : consumer_group }):
484
- app = Application (
485
- broker_address = "my_address" , consumer_group = consumer_group
486
- )
487
- assert app .config .consumer_group == consumer_group
482
+ with patch .dict (os .environ , {"Quix__Consumer_Group" : "environ_group" }):
483
+ app = Application (broker_address = "my_address" )
484
+ assert app .config .consumer_group == "environ_group"
485
+
486
+ with patch .dict (os .environ , {"Quix__Consumer_Group" : "environ_group" }):
487
+ app = Application (broker_address = "my_address" , consumer_group = "app_group" )
488
+ assert app .config .consumer_group == "app_group"
488
489
489
490
def test_consumer_group_default (self ):
490
491
"""
@@ -494,6 +495,21 @@ def test_consumer_group_default(self):
494
495
app = Application (broker_address = "my_address" )
495
496
assert app .config .consumer_group == "quixstreams-default"
496
497
498
+ def test_state_dir_env (self ):
499
+ """
500
+ Sanity check state_dir gets set from the environment via getenv.
501
+ """
502
+ app = Application (broker_address = "my_address" )
503
+ assert app .config .state_dir == Path ("state" )
504
+
505
+ with patch .dict (os .environ , {"Quix__State__Dir" : "/path/to/state" }):
506
+ app = Application (broker_address = "my_address" )
507
+ assert app .config .state_dir == Path ("/path/to/state" )
508
+
509
+ with patch .dict (os .environ , {"Quix__State__Dir" : "/path/to/state" }):
510
+ app = Application (broker_address = "my_address" , state_dir = "/path/to/other" )
511
+ assert app .config .state_dir == Path ("/path/to/other" )
512
+
497
513
498
514
class TestAppGroupBy :
499
515
def test_group_by (
0 commit comments