def test_set_drips_per_second_throws_error_if_not_using_emulated_drips(self, *args): self.setup_mocks(args) gcode_path = "FakeFile" self.mock_serial_drip_zaxis.set_drips_per_second.side_effect = Exception() config = self.default_config api = PrintAPI(config) with patch('__builtin__.open', mock_open(read_data='bibble'), create=True): api.print_gcode(gcode_path) with self.assertRaises(Exception): api.set_drips_per_second(12)
def test_set_drips_per_second_throws_error_if_not_using_emulated_drips( self, *args): self.setup_mocks(args) gcode_path = "FakeFile" self.mock_serial_drip_zaxis.set_drips_per_second.side_effect = Exception( ) config = self.default_config api = PrintAPI(config) with patch('__builtin__.open', mock_open(read_data='bibble'), create=True): api.print_gcode(gcode_path) with self.assertRaises(Exception): api.set_drips_per_second(12)