diff --git a/workspace_tools/host_tests/serial_nc_rx_auto.py b/workspace_tools/host_tests/serial_nc_rx_auto.py index 46388811fa..cd12ebe611 100644 --- a/workspace_tools/host_tests/serial_nc_rx_auto.py +++ b/workspace_tools/host_tests/serial_nc_rx_auto.py @@ -31,11 +31,10 @@ class SerialNCRXTest(): out_str = selftest.mbed.serial_readline() - if out_str == None: + if not out_str: selftest.notify("HOST: No output detected") return selftest.RESULT_IO_SERIAL - out_str_stripped = out_str.strip(strip_chars) if out_str_stripped != "RX OK - Expected": @@ -51,7 +50,7 @@ class SerialNCRXTest(): out_str = selftest.mbed.serial_readline() # If no characters received, pass the test - if out_str == "" or out_str == None: + if not out_str: selftest.notify("HOST: No further output detected") return selftest.RESULT_SUCCESS else: diff --git a/workspace_tools/host_tests/serial_nc_tx_auto.py b/workspace_tools/host_tests/serial_nc_tx_auto.py index e594061efc..549bbecb3c 100644 --- a/workspace_tools/host_tests/serial_nc_tx_auto.py +++ b/workspace_tools/host_tests/serial_nc_tx_auto.py @@ -26,13 +26,13 @@ class SerialNCTXTest(): def test(self, selftest): selftest.mbed.flush(); selftest.mbed.serial_write("S"); - + strip_chars = string.whitespace + "\0" out_str = selftest.mbed.serial_readline() selftest.notify("HOST: " + out_str) - if out_str == None: + if not out_str: selftest.notify("HOST: No output detected") return selftest.RESULT_IO_SERIAL @@ -45,7 +45,7 @@ class SerialNCTXTest(): out_str = selftest.mbed.serial_readline() # If no characters received, pass the test - if out_str == "" or out_str == None: + if not out_str: selftest.notify("HOST: No further output detected") return selftest.RESULT_SUCCESS else: