示例#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')
示例#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'))
示例#3
0
 def test_empty(self):
     s = Status(None)
     eq_(s.as_string, '')
     eq_(s.keyboard, None)
示例#4
0
 def test_empty(self):
     s = Status(None)
     assert s.as_string == ""
     assert s.keyboard == None
示例#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")
示例#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"
示例#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')