11from didww .enums import Feature , IdentityType , AreaLevel
2+ from didww .resources .did_group import DidGroup
23from tests .conftest import my_vcr
34from didww .query_params import QueryParams
45
@@ -11,6 +12,35 @@ def test_new_features_enum_values(self):
1112 assert Feature .CNAM_OUT .value == "cnam_out"
1213
1314
15+ class TestDidGroupFeaturesHuman :
16+ def test_features_human_maps_known_features (self ):
17+ dg = DidGroup ()
18+ dg .attributes ["features" ] = ["t38" , "voice_in" ]
19+ assert dg .features_human == ["T.38 Fax" , "Voice IN" ]
20+
21+ def test_features_human_falls_back_to_raw_key_for_unknown (self ):
22+ dg = DidGroup ()
23+ dg .attributes ["features" ] = ["voice_in" , "future_unknown_feature" ]
24+ assert dg .features_human == ["Voice IN" , "future_unknown_feature" ]
25+
26+ def test_features_human_empty_list (self ):
27+ dg = DidGroup ()
28+ dg .attributes ["features" ] = []
29+ assert dg .features_human == []
30+
31+ def test_features_human_none (self ):
32+ dg = DidGroup ()
33+ assert dg .features_human == []
34+
35+ def test_features_human_all_known_features (self ):
36+ dg = DidGroup ()
37+ dg .attributes ["features" ] = ["voice_in" , "voice_out" , "t38" , "sms_in" , "p2p" , "a2p" , "emergency" , "cnam_out" ]
38+ assert dg .features_human == [
39+ "Voice IN" , "Voice OUT" , "T.38 Fax" , "SMS IN" ,
40+ "P2P SMS" , "A2P SMS" , "Emergency" , "CNAM OUT" ,
41+ ]
42+
43+
1444class TestDidGroup :
1545 @my_vcr .use_cassette ("did_groups/list.yaml" )
1646 def test_list_did_groups (self , client ):
0 commit comments