Esempio n. 1
0
 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")
Esempio n. 2
0
 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")
Esempio n. 3
0
 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
Esempio n. 4
0
 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