@@ -32,6 +32,7 @@ def test_new_class_property_added():
3232 "azure.ai.contentsafety" : {
3333 "class_nodes" : {
3434 "AnalyzeTextResult" : {
35+ "type" : None ,
3536 "methods" : {},
3637 "properties" : {
3738 "blocklists_match" : "Optional" ,
@@ -47,6 +48,7 @@ def test_new_class_property_added():
4748 "azure.ai.contentsafety" : {
4849 "class_nodes" : {
4950 "AnalyzeTextResult" : {
51+ "type" : None ,
5052 "methods" : {},
5153 "properties" : {
5254 "blocklists_match" : "Optional" ,
@@ -144,6 +146,7 @@ def test_new_class_property_added_init():
144146 "azure.ai.contentsafety" : {
145147 "class_nodes" : {
146148 "AnalyzeTextResult" : {
149+ "type" : None ,
147150 "methods" : {
148151 "__init__" : {
149152 "parameters" : {
@@ -177,6 +180,7 @@ def test_new_class_property_added_init():
177180 "azure.ai.contentsafety" : {
178181 "class_nodes" : {
179182 "AnalyzeTextResult" : {
183+ "type" : None ,
180184 "methods" : {
181185 "__init__" : {
182186 "parameters" : {
@@ -390,6 +394,7 @@ def test_added_operation_group():
390394 "azure.contoso" : {
391395 "class_nodes" : {
392396 "ContosoClient" : {
397+ "type" : None ,
393398 "methods" : {},
394399 "properties" : {
395400 "bar" : {
@@ -405,6 +410,7 @@ def test_added_operation_group():
405410 "azure.contoso" : {
406411 "class_nodes" : {
407412 "ContosoClient" : {
413+ "type" : None ,
408414 "methods" : {},
409415 "properties" : {
410416 "bar" : {
@@ -438,6 +444,7 @@ def test_ignore_changes():
438444 "azure.contoso" : {
439445 "class_nodes" : {
440446 "ContosoClient" : {
447+ "type" : None ,
441448 "methods" : {},
442449 "properties" : {
443450 "bar" : {
@@ -453,6 +460,7 @@ def test_ignore_changes():
453460 "azure.contoso" : {
454461 "class_nodes" : {
455462 "ContosoClient" : {
463+ "type" : None ,
456464 "methods" : {},
457465 "properties" : {
458466 "bar" : {
@@ -497,3 +505,53 @@ def test_async_features_added_cleanup():
497505 assert len (ct .features_added ) == 2
498506 assert ct .features_added [0 ] == ("Message" , "AddedClient" , "azure.contoso" , "FooClient" , "foo" )
499507 assert ct .features_added [1 ] == ("Message" , "AddedClassMethod" , "azure.contoso" , "FooClient" , "from_connection_string" )
508+
509+
510+ def test_new_enum_added ():
511+ current = {
512+ "azure.contoso.widgetmanager" : {
513+ "class_nodes" : {
514+ "WidgetEnum" : {
515+ "type" : "Enum" ,
516+ "methods" : {},
517+ "properties" : {
518+ "a" : "a" ,
519+ "b" : "b" ,
520+ }
521+ },
522+ "ManagerEnum" : {
523+ "type" : "Enum" ,
524+ "methods" : {},
525+ "properties" : {
526+ "foo" : "foo" ,
527+ "bar" : "bar" ,
528+ }
529+ },
530+ }
531+ }
532+ }
533+
534+ stable = {
535+ "azure.contoso.widgetmanager" : {
536+ "class_nodes" : {
537+ "ManagerEnum" : {
538+ "type" : "Enum" ,
539+ "methods" : {},
540+ "properties" : {
541+ "foo" : "foo" ,
542+ }
543+ },
544+ }
545+ }
546+ }
547+
548+ bc = ChangelogTracker (stable , current , "azure-contoso-widgetmanager" )
549+ bc .run_checks ()
550+
551+ assert len (bc .features_added ) == 2
552+ msg , _ , * args = bc .features_added [0 ]
553+ assert msg == ChangelogTracker .ADDED_ENUM_MEMBER_MSG
554+ assert args == ['azure.contoso.widgetmanager' , 'ManagerEnum' , 'bar' ]
555+ msg , _ , * args = bc .features_added [1 ]
556+ assert msg == ChangelogTracker .ADDED_ENUM_MSG
557+ assert args == ['azure.contoso.widgetmanager' , 'WidgetEnum' ]
0 commit comments