@@ -602,7 +602,7 @@ def test_global_read_only_without_zones():
602602 env = ProxyConfigEnvironment (
603603 name = "Test Global Read Only" ,
604604 token_sha512 = dummy_proxy_environment_token_sha512 ,
605- global_read_only = True
605+ global_read_only = True ,
606606 )
607607 assert env .global_read_only is True
608608 assert env .zones == []
@@ -612,21 +612,22 @@ def test_environment_with_neither_zones_nor_global_read_only_fails():
612612 """Test that providing neither zones nor global_read_only fails validation"""
613613 with pytest .raises (ValueError ) as err :
614614 ProxyConfigEnvironment (
615- name = "test" ,
616- token_sha512 = dummy_proxy_environment_token_sha512
615+ name = "test" , token_sha512 = dummy_proxy_environment_token_sha512
617616 )
618- assert "Either 'zones' must be non-empty or 'global_read_only' must be True" in str (err .value )
617+ assert "Either 'zones' must be non-empty or 'global_read_only' must be True" in str (
618+ err .value
619+ )
619620
620621
621622def test_environment_with_empty_zones_and_no_global_read_only_fails ():
622623 """Test that explicitly providing empty zones without global_read_only fails"""
623624 with pytest .raises (ValueError ) as err :
624625 ProxyConfigEnvironment (
625- name = "test" ,
626- token_sha512 = dummy_proxy_environment_token_sha512 ,
627- zones = []
626+ name = "test" , token_sha512 = dummy_proxy_environment_token_sha512 , zones = []
628627 )
629- assert "Either 'zones' must be non-empty or 'global_read_only' must be True" in str (err .value )
628+ assert "Either 'zones' must be non-empty or 'global_read_only' must be True" in str (
629+ err .value
630+ )
630631
631632
632633def test_proxy_config_with_global_read_only_environment ():
@@ -638,9 +639,9 @@ def test_proxy_config_with_global_read_only_environment():
638639 ProxyConfigEnvironment (
639640 name = "foo" ,
640641 token_sha512 = dummy_proxy_environment_token_sha512 ,
641- global_read_only = True
642+ global_read_only = True ,
642643 )
643- ]
644+ ],
644645 )
645646 assert config .environments [0 ].global_read_only is True
646647 assert config .environments [0 ].zones == []
@@ -651,21 +652,21 @@ def test_global_read_only_with_explicit_zones_keeps_zone_permissions():
651652 # Create a zone that should remain writable
652653 writable_zone = ProxyConfigZone (name = "example.com" , read_only = False )
653654 readonly_zone = ProxyConfigZone (name = "readonly.com" , read_only = True )
654-
655+
655656 env = ProxyConfigEnvironment (
656657 name = "Test Global Read Only with Zones" ,
657658 token_sha512 = dummy_proxy_environment_token_sha512 ,
658659 zones = [writable_zone , readonly_zone ],
659- global_read_only = True
660+ global_read_only = True ,
660661 )
661-
662+
662663 # global_read_only should be True
663664 assert env .global_read_only is True
664-
665+
665666 # But explicit zones should keep their original read_only settings
666667 assert env .zones [0 ].read_only is False # writable_zone should remain writable
667- assert env .zones [1 ].read_only is True # readonly_zone should remain read_only
668-
668+ assert env .zones [1 ].read_only is True # readonly_zone should remain read_only
669+
669670 # Should have access to zones via lookup
670671 assert len (env ._zones_lookup ) == 2
671672 assert "example.com" in env ._zones_lookup
0 commit comments