How to use the sarge.Pipeline function in sarge

To help you get started, we’ve selected a few sarge examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OctoPrint / OctoPrint-FirmwareUpdater / tests / test_firmwareupdater.py View on Github external
	@mock.patch.object(sarge.Pipeline, 'wait_events')
	@mock.patch('sarge.run')
	@mock.patch('octoprint_firmwareupdater.os.path.dirname')
	def test_flash_worker_ok(self, mock_dirname, mock_sarge_run, mock_wait_events, mock_send_status):
		# Set Up
		self.plugin = octoprint_firmwareupdater.FirmwareupdaterPlugin()
		self.plugin._settings = settings_mock()
		self.plugin._logger = logger_mock()
		self.plugin._printer = printer_mock()
		p = pipeline_mock()
		mock_sarge_run.return_value = p

		hex_file = named_temporary_file_mock()
		hex_file.close = mock.MagicMock(name='close')

		# Call test subject
		self.plugin._flash_worker(hex_file, "port")

sarge

A wrapper for subprocess which provides command pipeline functionality.

BSD-2-Clause
Latest version published 3 years ago

Package Health Score

52 / 100
Full package analysis