Repository: microsoft/botbuilder-python

Issue:
Support for new installation action types (Python)
See [parent](https://github.com/microsoft/botframework-sdk/issues/6139)


Discussion:

Resolving patch:
diff --git a/libraries/botbuilder-core/botbuilder/core/activity_handler.py b/libraries/botbuilder-core/botbuilder/core/activity_handler.py
--- a/libraries/botbuilder-core/botbuilder/core/activity_handler.py
+++ b/libraries/botbuilder-core/botbuilder/core/activity_handler.py
@@ -381,9 +381,9 @@ async def on_installation_update(  # pylint: disable=unused-argument
         :type turn_context: :class:`botbuilder.core.TurnContext`
         :returns: A task that represents the work queued to execute
         """
-        if turn_context.activity.action == "add":
+        if turn_context.activity.action in ("add", "add-upgrade"):
             return await self.on_installation_update_add(turn_context)
-        if turn_context.activity.action == "remove":
+        if turn_context.activity.action in ("remove", "remove-upgrade"):
             return await self.on_installation_update_remove(turn_context)
         return
 


Test patch:
diff --git a/libraries/botbuilder-core/tests/test_activity_handler.py b/libraries/botbuilder-core/tests/test_activity_handler.py
--- a/libraries/botbuilder-core/tests/test_activity_handler.py
+++ b/libraries/botbuilder-core/tests/test_activity_handler.py
@@ -268,7 +268,23 @@ async def test_on_installation_update_add(self):
         assert bot.record[0] == "on_installation_update"
         assert bot.record[1] == "on_installation_update_add"
 
-    async def test_on_installation_update_add_remove(self):
+    async def test_on_installation_update_add_upgrade(self):
+        activity = Activity(
+            type=ActivityTypes.installation_update, action="add-upgrade"
+        )
+
+        adapter = TestInvokeAdapter()
+        turn_context = TurnContext(adapter, activity)
+
+        # Act
+        bot = TestingActivityHandler()
+        await bot.on_turn(turn_context)
+
+        assert len(bot.record) == 2
+        assert bot.record[0] == "on_installation_update"
+        assert bot.record[1] == "on_installation_update_add"
+
+    async def test_on_installation_update_remove(self):
         activity = Activity(type=ActivityTypes.installation_update, action="remove")
 
         adapter = TestInvokeAdapter()
@@ -282,6 +298,22 @@ async def test_on_installation_update_add_remove(self):
         assert bot.record[0] == "on_installation_update"
         assert bot.record[1] == "on_installation_update_remove"
 
+    async def test_on_installation_update_remove_upgrade(self):
+        activity = Activity(
+            type=ActivityTypes.installation_update, action="remove-upgrade"
+        )
+
+        adapter = TestInvokeAdapter()
+        turn_context = TurnContext(adapter, activity)
+
+        # Act
+        bot = TestingActivityHandler()
+        await bot.on_turn(turn_context)
+
+        assert len(bot.record) == 2
+        assert bot.record[0] == "on_installation_update"
+        assert bot.record[1] == "on_installation_update_remove"
+
     async def test_healthcheck(self):
         activity = Activity(type=ActivityTypes.invoke, name="healthcheck",)