def test_write_timeout(self): """Make sure write fails when wrong response length received.""" s = Mock(write=Mock(return_value=1)) n = NodeMCU(s) with pytest.raises(IOError): n.write(b"fails")
def test_write(self): """Write wrapper should work as expected...""" s = Mock(write=Mock(return_value=6)) n = NodeMCU(s) assert n.write(b"passes") == 6