Example #1
0
 def test_merge_find_task_parameters_default_workspace(self):
     """
     Test that merge_find_task_parameters correctly merges the default and method parameters when we
     do not override the default workspace.
     :return: None
     """
     conn = Connection(conn_type="asana",
                       password="******",
                       extra='{"extra__asana__workspace": "1"}')
     with patch.object(AsanaHook, "get_connection", return_value=conn):
         hook = AsanaHook()
     expected_merged_params = {"workspace": "1", "assignee": "1"}
     self.assertEqual(
         expected_merged_params,
         hook._merge_find_task_parameters({"assignee": "1"}),  # pylint: disable=W0212
     )
Example #2
0
 def test_merge_find_task_parameters_specified_project_overrides_workspace(
         self):
     """
     Test that merge_find_task_parameters uses the method parameter project over the default workspace
     if it is available
     :return: None
     """
     conn = Connection(
         conn_type="asana",
         password="******",
         extra='{"extra__asana__workspace": "1"}',
     )
     with patch.object(AsanaHook, "get_connection", return_value=conn):
         hook = AsanaHook()
     expected_merged_params = {"project": "2"}
     self.assertEqual(
         expected_merged_params,
         hook._merge_find_task_parameters({"project": "2"}),  # pylint: disable=W0212
     )