diff --git a/base/actions/actions.py b/base/actions/actions.py index 879773a..9ac082e 100644 --- a/base/actions/actions.py +++ b/base/actions/actions.py @@ -173,7 +173,7 @@ def submit( domain: Dict[Text, Any], ) -> List[Dict]: """Define what the form has to do - after all required slots are filled""" + after all required slots are filled""" # utter submit template return [] @@ -516,7 +516,7 @@ def submit( domain: Dict[Text, Any], ) -> List[Dict]: """Define what the form has to do - after all required slots are filled""" + after all required slots are filled""" # utter submit template return [] @@ -796,7 +796,7 @@ async def submit( domain: Dict[Text, Any], ) -> List[Dict]: """Define what the form has to do - after all required slots are filled""" + after all required slots are filled""" data = self.get_risk_data(tracker) risk = utils.get_risk_level(data) study_a_arm = None diff --git a/base/tests/test_forms.py b/base/tests/test_forms.py index 15c1800..e8b602e 100644 --- a/base/tests/test_forms.py +++ b/base/tests/test_forms.py @@ -245,7 +245,10 @@ async def test_validate_location_text(self): """ form = HealthCheckProfileForm() - tracker = self.get_tracker_for_text_slot_with_message("location", "Cape Town",) + tracker = self.get_tracker_for_text_slot_with_message( + "location", + "Cape Town", + ) events = await form.validate(CollectingDispatcher(), tracker, {}) assert events == [ @@ -265,7 +268,10 @@ async def test_validate_location_google_places(self): "geometry": {"location": {"lat": 1.23, "lng": 4.56}}, } - tracker = self.get_tracker_for_text_slot_with_message("location", "Cape Town",) + tracker = self.get_tracker_for_text_slot_with_message( + "location", + "Cape Town", + ) events = await form.validate(CollectingDispatcher(), tracker, {}) assert events == [ @@ -285,7 +291,10 @@ async def test_validate_location_google_places_no_results(self): form.places_lookup = utils.AsyncMock() form.places_lookup.return_value = None - tracker = self.get_tracker_for_text_slot_with_message("location", "Cape Town",) + tracker = self.get_tracker_for_text_slot_with_message( + "location", + "Cape Town", + ) dispatcher = CollectingDispatcher() events = await form.validate(dispatcher, tracker, {}) @@ -308,7 +317,10 @@ async def test_validate_location_google_places_error(self): form.places_lookup = utils.AsyncMock() form.places_lookup.side_effect = Exception() - tracker = self.get_tracker_for_text_slot_with_message("location", "Cape Town",) + tracker = self.get_tracker_for_text_slot_with_message( + "location", + "Cape Town", + ) dispatcher = CollectingDispatcher() events = await form.validate(dispatcher, tracker, {}) @@ -505,7 +517,9 @@ def test_complete_form(self): form = HealthCheckProfileForm() dispatcher = CollectingDispatcher() tracker = utils.get_tracker_for_slot_from_intent( - form, "medical_condition", "no", + form, + "medical_condition", + "no", ) result = form.submit(dispatcher, tracker, {}) assert result == [] @@ -857,7 +871,14 @@ async def test_validate_yes_no_maybe(self): class TestActionSendStudyMessages: def get_tracker_with_slot(self, slots): return Tracker( - "default", slots, {"text": "test"}, [], False, None, {}, "action_listen", + "default", + slots, + {"text": "test"}, + [], + False, + None, + {}, + "action_listen", ) @pytest.mark.asyncio diff --git a/hh/actions/actions.py b/hh/actions/actions.py index 759b417..e44f40e 100644 --- a/hh/actions/actions.py +++ b/hh/actions/actions.py @@ -361,7 +361,7 @@ async def submit( domain: Dict[Text, Any], ) -> List[Dict]: """Define what the form has to do - after all required slots are filled""" + after all required slots are filled""" return [] diff --git a/hh/tests/test_actions.py b/hh/tests/test_actions.py index ce1b5ab..e363814 100644 --- a/hh/tests/test_actions.py +++ b/hh/tests/test_actions.py @@ -60,7 +60,8 @@ def test_validate_destination_province(self): dispatcher = CollectingDispatcher() response = form.validate_destination_province("1", dispatcher, tracker, {}) self.assertEqual( - response, {"destination_province": "ec"}, + response, + {"destination_province": "ec"}, ) def test_validate_university(self): @@ -108,7 +109,8 @@ def test_validate_university_confirm(self): dispatcher = CollectingDispatcher() response = form.validate_university_confirm("1", dispatcher, tracker, {}) self.assertEqual( - response, {"university_confirm": "AFDA", "campus_list": "*1.* Cenral"}, + response, + {"university_confirm": "AFDA", "campus_list": "*1.* Cenral"}, ) def test_validate_campus(self): @@ -126,7 +128,8 @@ def test_validate_campus(self): dispatcher = CollectingDispatcher() response = form.validate_campus("1", dispatcher, tracker, {}) self.assertEqual( - response, {"campus": "Cenral"}, + response, + {"campus": "Cenral"}, ) @patch("hh.actions.actions.CollectingDispatcher.utter_message") @@ -145,7 +148,8 @@ def test_validate_vaccine_uptake(self, mock_utter): dispatcher = CollectingDispatcher() response = form.validate_vaccine_uptake("3", dispatcher, tracker, {}) self.assertEqual( - response, {"vaccine_uptake": "NOT"}, + response, + {"vaccine_uptake": "NOT"}, ) mock_utter.assert_called_once_with(template="utter_not_vaccinated") @@ -466,7 +470,16 @@ async def test_assign_study_b_arm(self): } events = await action.run( dispatcher, - Tracker("27820001001", {}, {}, [], False, None, {}, "action_listen",), + Tracker( + "27820001001", + {}, + {}, + [], + False, + None, + {}, + "action_listen", + ), {}, ) assert SlotSet("start_time", "2022-03-09T07:33:29.046948Z") in events