def test_process_devhub_output(self):
     """ username is parsed from json response """
     del self.task_config.config["options"]["username"]
     task = CreateConnectedApp(self.project_config, self.task_config)
     task._process_devhub_output('{"result":[{"value":"' + self.username +
                                 '"}]}')
     self.assertEqual(task.options.get("username"), self.username)
Exemple #2
0
 def test_process_devhub_output_not_configured(self):
     """ TaskOptionsError is raised if no username provided and no default found """
     del self.task_config.config["options"]["username"]
     task = CreateConnectedApp(self.project_config, self.task_config)
     with pytest.raises(TaskOptionsError, match="^No sfdx config found"):
         task._process_devhub_output('{"result":[{}]}')
 def test_process_devhub_output_not_configured(self):
     """ TaskOptionsError is raised if no username provided and no default found """
     del self.task_config.config["options"]["username"]
     task = CreateConnectedApp(self.project_config, self.task_config)
     with pytest.raises(TaskOptionsError, match="^No sfdx config found"):
         task._process_devhub_output('{"result":[{}]}')
 def test_process_devhub_output(self):
     """ username is parsed from json response """
     del self.task_config.config["options"]["username"]
     task = CreateConnectedApp(self.project_config, self.task_config)
     task._process_devhub_output('{"result":[{"value":"' + self.username + '"}]}')
     self.assertEqual(task.options.get("username"), self.username)