def test_run_services_path_none(self, mock_pretty_output): args = mock.MagicMock(services_file=None, only_dependencies=False, without_dependencies=False) self.mock_path.exists.return_value = False install_commands.run_services('foo', args) po_call_args = mock_pretty_output().__enter__().write.call_args_list self.assertEqual('No Services file found.', po_call_args[0][0][0])
def test_run_services(self, mock_open_file, mock_pretty_output, _): args = mock.MagicMock(services_file='services_file', only_dependencies=False, without_dependencies=False) self.mock_path.exists.return_value = True mock_open_file.side_effect = ['service_file', ''] install_commands.run_services('foo', args) install_commands.run_services('foo', args) po_call_args = mock_pretty_output().__enter__().write.call_args_list self.assertEqual('No Services listed in Services file.', po_call_args[0][0][0])