Ejemplo n.º 1
0
 def test_split(self):
     statstr = b'U F U C(192.85.72.197) I 4 24 80 16 22 0x0 0.082'
     s = Status(statstr)
     eq_(s.as_string, statstr.decode('ascii'))
     eq_(s.keyboard, b'U')
Ejemplo n.º 2
0
 def test_str_magic(self):
     statstr = b'U F U C(192.85.72.197) I 4 24 80 16 22 0x0 0.082'
     s = Status(statstr)
     eq_(str(s), 'STATUS: ' + statstr.decode('ascii'))
Ejemplo n.º 3
0
 def test_empty(self):
     s = Status(None)
     eq_(s.as_string, '')
     eq_(s.keyboard, None)
Ejemplo n.º 4
0
 def test_empty(self):
     s = Status(None)
     assert s.as_string == ""
     assert s.keyboard == None
Ejemplo n.º 5
0
 def test_str_magic(self):
     statstr = b"U F U C(192.85.72.197) I 4 24 80 16 22 0x0 0.082"
     s = Status(statstr)
     assert str(s) == "STATUS: " + statstr.decode("ascii")
Ejemplo n.º 6
0
 def test_split(self):
     statstr = b"U F U C(192.85.72.197) I 4 24 80 16 22 0x0 0.082"
     s = Status(statstr)
     assert s.as_string == statstr.decode("ascii")
     assert s.keyboard == b"U"
Ejemplo n.º 7
0
 def test_split(self):
     statstr = 'U F U C(192.85.72.197) I 4 24 80 16 22 0x0 0.082'
     s = Status(statstr)
     eq_(s.as_string, statstr)
     eq_(s.keyboard, 'U')