@@ -33,8 +33,14 @@ def test_known_category_is_preserved(self):
3333 self .assertEqual (alert .category , SocketCategory .SUPPLY_CHAIN_RISK )
3434 self .assertEqual (alert .severity , SocketIssueSeverity .LOW )
3535
36- def test_unknown_category_falls_back_to_miscellaneous (self ):
36+ def test_other_category_is_recognized (self ):
37+ # "other" is a known backend category as of CE-225; it should resolve to
38+ # SocketCategory.OTHER rather than falling back to MISCELLANEOUS.
3739 alert = SocketAlert .from_dict (self ._base_payload ("other" ))
40+ self .assertEqual (alert .category , SocketCategory .OTHER )
41+
42+ def test_unknown_category_falls_back_to_miscellaneous (self ):
43+ alert = SocketAlert .from_dict (self ._base_payload ("somethingCompletelyNew" ))
3844 self .assertEqual (alert .category , SocketCategory .MISCELLANEOUS )
3945
4046 def test_unknown_category_does_not_raise (self ):
@@ -46,7 +52,7 @@ def test_unknown_category_does_not_raise(self):
4652
4753 def test_unknown_category_emits_warning (self ):
4854 with self .assertLogs ("socketdev" , level = logging .WARNING ) as captured :
49- SocketAlert .from_dict (self ._base_payload ("other " ))
55+ SocketAlert .from_dict (self ._base_payload ("somethingCompletelyNew " ))
5056 self .assertTrue (
5157 any ("Unknown SocketCategory" in message for message in captured .output ),
5258 f"expected a warning about the unknown category, got: { captured .output } " ,
0 commit comments