Skip to content

Commit

Permalink
Fixing tests after min->MIN change
Browse files Browse the repository at this point in the history
  • Loading branch information
rbiasini committed Jun 30, 2019
1 parent ecb9b6c commit 3e9469b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion python/esptool.py
Original file line number Diff line number Diff line change
Expand Up @@ -1216,7 +1216,7 @@ def add_spi_flash_subparsers(parent, auto_detect=False):
operation_func = globals()[args.operation]
operation_args,_,_,_ = inspect.getargspec(operation_func)
if operation_args[0] == 'esp': # operation function takes an ESPROM connection object
initial_baud = MIN(ESPROM.ESP_ROM_BAUD, args.baud) # don't sync faster than the default baud rate
initial_baud = min(ESPROM.ESP_ROM_BAUD, args.baud) # don't sync faster than the default baud rate
esp = ESPROM(args.port, initial_baud)
esp.connect()
operation_func(esp, args)
Expand Down
6 changes: 3 additions & 3 deletions tests/elm_car_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def __lin_process_msg(self, priority, toaddr, fromaddr, data):
if len(outmsg) <= 5:
self._lin_send(0x10, obd_header + outmsg)
else:
first_msg_len = MIN(4, len(outmsg)%4) or 4
first_msg_len = min(4, len(outmsg)%4) or 4
self._lin_send(0x10, obd_header + b'\x01' +
b'\x00'*(4-first_msg_len) +
outmsg[:first_msg_len])
Expand Down Expand Up @@ -229,7 +229,7 @@ def __can_process_msg(self, mode, pid, address, ts, data, src):
outaddr = 0x7E8 if address == 0x7DF or address == 0x7E0 else 0x18DAF110
msgnum = 1
while(self.__can_multipart_data):
datalen = MIN(7, len(self.__can_multipart_data))
datalen = min(7, len(self.__can_multipart_data))
msgpiece = struct.pack("B", 0x20 | msgnum) + self.__can_multipart_data[:datalen]
self._can_send(outaddr, msgpiece)
self.__can_multipart_data = self.__can_multipart_data[7:]
Expand All @@ -246,7 +246,7 @@ def __can_process_msg(self, mode, pid, address, ts, data, src):
self._can_send(outaddr,
struct.pack("BBB", len(outmsg)+2, 0x40|data[1], pid) + outmsg)
else:
first_msg_len = MIN(3, len(outmsg)%7)
first_msg_len = min(3, len(outmsg)%7)
payload_len = len(outmsg)+3
msgpiece = struct.pack("BBBBB", 0x10 | ((payload_len>>8)&0xF),
payload_len&0xFF,
Expand Down

0 comments on commit 3e9469b

Please sign in to comment.