コード例 #1
0
ファイル: test_protomidi.py プロジェクト: ptone/protomidi
def test_serialize_and_parse():
    """
    Serialize a message and parse it. Should return the same message.
    """
    msg1 = protomidi.msg.note_on
    msg2 = protomidi.parse(protomidi.serialize(msg1))[0]
    assert msg2 == msg1
コード例 #2
0
ファイル: test_protomidi.py プロジェクト: ptone/protomidi
def test_serialize_and_parse():
    """
    Serialize a message and parse it. Should return the same message.
    """
    msg1 = protomidi.msg.note_on
    msg2 = protomidi.parse(protomidi.serialize(msg1))[0]
    assert msg2 == msg1
コード例 #3
0
ファイル: test_protomidi.py プロジェクト: ptone/protomidi
def test_pitchwheel_max():
    """
    Check if pitchwheel with maximal value serializes correctly.
    """
    msg = protomidi.msg.pitchwheel(value=protomidi.msg.pitchwheel_max)
    bytes = protomidi.serialize(msg)

    assert bytes[1] == bytes[2] == 127
コード例 #4
0
ファイル: test_protomidi.py プロジェクト: ptone/protomidi
def test_pitchwheel_max():
    """
    Check if pitchwheel with maximal value serializes correctly.
    """
    msg = protomidi.msg.pitchwheel(value=protomidi.msg.pitchwheel_max)
    bytes = protomidi.serialize(msg)

    assert bytes[1] == bytes[2] == 127
コード例 #5
0
ファイル: test_protomidi.py プロジェクト: ptone/protomidi
def test_pitchwheel_serialize_parse():
    """
    Check if pitchwheel with maximal value serializes correctly.
    """
    msg1 = protomidi.msg.pitchwheel(value=0)
    bytes = protomidi.serialize(msg1)
    msg2 = protomidi.parse(bytes)[0]

    assert msg1 == msg2
コード例 #6
0
ファイル: test_protomidi.py プロジェクト: ptone/protomidi
def test_pitchwheel_serialize_parse():
    """
    Check if pitchwheel with maximal value serializes correctly.
    """
    msg1 = protomidi.msg.pitchwheel(value=0)
    bytes = protomidi.serialize(msg1)
    msg2 = protomidi.parse(bytes)[0]

    assert msg1 == msg2