- Timestamp:
- 05/15/10 01:04:11 (2 years ago)
- Children:
- 3d477f9e40ceaedf2ee58027d5e0a5c098150f62
- Parents:
- 811533e58cd3e57fc04f2e7809d3f6ddd6198a82
- git-committer:
- Luper Rouch <luper.rouch@…> (05/15/10 01:04:11)
- File:
-
- 1 edited
-
pompilop/pompilop/tests/test_serial.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pompilop/pompilop/tests/test_serial.py
r9d933f3 r0280387 1 1 from nose.tools import assert_equal 2 from pompilop.serial import checksum, format_commands, Command 2 from pompilop.serial import checksum, format_commands, Command, base96 3 3 4 4 … … 17 17 def test_format(): 18 18 data = [ 19 (Command(Command.MUTE, False, 2, 1),19 (Command(Command.MUTE, 2, 1, input=False), 20 20 "\x01\x57\x7F\x03\x4D\x55\x54\x30\x08\x20\x09\x21\x0A" 21 21 "\x22\x10\x21\x1F\x2E\x02"), 22 (Command(Command.EQ_FREQUENCY, True, 3, aux=5),22 (Command(Command.EQ_FREQUENCY, 3, 1, aux=5, input=True), 23 23 "\x01\x57\x7F\x03\x45\x51\x46\x30\x08\x20\x09\x20\x0A" 24 24 "\x23\x0B\x25\x10\x21\x1F\x44\x02"), … … 26 26 for cmd, expected in data: 27 27 assert_equal(format_commands([cmd]), expected) 28 29 30 def test_base96(): 31 assert_equal(base96(0), "\x20") 32 assert_equal(base96(1), "\x21") 33 assert_equal(base96(0x60), "\x7f") 34 assert_equal(base96(0x61), "\x21\x7f") 35
Note: See TracChangeset
for help on using the changeset viewer.
