Example #1
0
    def test_update_credentials(self):
        def update_config(keychain):
            self.org_config.config["new"] = "new"

        self.org_config.refresh_oauth_token = update_config
        task = BaseSalesforceTask(self.project_config, self.task_config,
                                  self.org_config)
        task._run_task = mock.Mock()
        task()
        self.project_config.keychain.set_org.assert_called_once()
    def test_update_credentials(self):
        def update_config(keychain):
            self.org_config.config["new"] = "new"

        self.org_config.refresh_oauth_token = update_config
        task = BaseSalesforceTask(
            self.project_config, self.task_config, self.org_config
        )
        task._run_task = mock.Mock()
        task()
        self.project_config.keychain.set_org.assert_called_once()
Example #3
0
    def test_update_credentials(self):
        update_config_called = False

        def update_config(keychain, save=False):
            nonlocal update_config_called
            update_config_called = True
            self.org_config.config["new"] = "new"

        self.org_config.refresh_oauth_token = update_config
        task = BaseSalesforceTask(self.project_config, self.task_config,
                                  self.org_config)
        task._run_task = mock.Mock()
        task()
        assert update_config_called
        self.project_config.keychain.set_org.assert_called_once()
 def test_run_task(self):
     with mock.patch(
             "cumulusci.tasks.salesforce.BaseSalesforceTask._update_credentials"
     ):
         task = BaseSalesforceTask(self.project_config, self.task_config,
                                   self.org_config)
         with self.assertRaises(NotImplementedError):
             task()