Esempio n. 1
0
 def test_parse_strokes(self):
     data = bytearray()
     # SAT
     a = 0b11001000
     b = 0b11000100
     c = 0b11000000
     d = 0b11001000
     data.extend([a, b, c, d])
     # PRAOERBGS
     a = 0b11000001
     b = 0b11001110
     c = 0b11100101
     d = 0b11010100
     data.extend([a, b, c, d])
     strokes = stentura._parse_strokes(bytes(data))
     expected = [['S-', 'A-', '-T'],
                 ['P-', 'R-', 'A-', 'O-', '-E', '-R', '-B', '-G', '-S']]
     for i, stroke in enumerate(strokes):
         self.assertCountEqual(stroke, expected[i])
Esempio n. 2
0
 def test_parse_strokes(self):
     data = bytearray()
     # SAT
     a = 0b11001000
     b = 0b11000100
     c = 0b11000000
     d = 0b11001000
     data.extend([a, b, c, d])
     # PRAOERBGS
     a = 0b11000001
     b = 0b11001110
     c = 0b11100101
     d = 0b11010100
     data.extend([a, b, c, d])
     strokes = stentura._parse_strokes(bytes(data))
     expected = [['S-', 'A-', '-T'],
                 ['P-', 'R-', 'A-', 'O-', '-E', '-R', '-B', '-G', '-S']]
     for i, stroke in enumerate(strokes):
         assertCountEqual(self, stroke, expected[i])
Esempio n. 3
0
 def test_parse_strokes(self):
     data = []
     # SAT
     a = 0b11001000
     b = 0b11000100
     c = 0b11000000
     d = 0b11001000
     data.extend([a, b, c, d])
     # PRAOERBGS
     a = 0b11000001
     b = 0b11001110
     c = 0b11100101
     d = 0b11010100
     data.extend([a, b, c, d])
     strokes = stentura._parse_strokes(''.join([chr(b) for b in data]))
     expected = [['S-', 'A-', '-T'],
                 ['P-', 'R-', 'A-', 'O-', '-E', '-R', '-B', '-G', '-S']]
     for i, stroke in enumerate(strokes):
         self.assertItemsEqual(stroke, expected[i])
Esempio n. 4
0
 def test_parse_strokes(self):
     data = []
     # SAT
     a = 0b11001000
     b = 0b11000100
     c = 0b11000000
     d = 0b11001000
     data.extend([a, b, c, d])
     # PRAOERBGS
     a = 0b11000001
     b = 0b11001110
     c = 0b11100101
     d = 0b11010100
     data.extend([a, b, c, d])
     strokes = stentura._parse_strokes(''.join([chr(b) for b in data]))
     expected = [['S-', 'A-', '-T'],
                 ['P-', 'R-', 'A-', 'O-', '-E', '-R', '-B', '-G', '-S']]
     for i, stroke in enumerate(strokes):
         self.assertItemsEqual(stroke, expected[i])
Esempio n. 5
0
def test_parse_strokes():
    data = bytearray()
    # SAT
    a = 0b11001000
    b = 0b11000100
    c = 0b11000000
    d = 0b11001000
    data.extend([a, b, c, d])
    # PRAOERBGS
    a = 0b11000001
    b = 0b11001110
    c = 0b11100101
    d = 0b11010100
    data.extend([a, b, c, d])
    for result, expected in zip(
        stentura._parse_strokes(bytes(data)),
        [['S-', 'A-', '-T'],
         ['P-', 'R-', 'A-', 'O-', '-E', '-R', '-B', '-G', '-S']],
    ):
        assert sorted(result) == sorted(expected)
Esempio n. 6
0
def test_parse_strokes():
    data = bytearray()
    # SAT
    a = 0b11001000
    b = 0b11000100
    c = 0b11000000
    d = 0b11001000
    data.extend([a, b, c, d])
    # PRAOERBGS
    a = 0b11000001
    b = 0b11001110
    c = 0b11100101
    d = 0b11010100
    data.extend([a, b, c, d])
    for result, expected in zip(
            stentura._parse_strokes(bytes(data)),
        [['S-', 'A-', '-T'],
         ['P-', 'R-', 'A-', 'O-', '-E', '-R', '-B', '-G', '-S']],
    ):
        assert sorted(result) == sorted(expected)