def Blue__test__():
    '''
    Test that the formats are consistant by reading and writing
    to a file.  No real bluetooth required.
    '''
    # read
    b = Blue(filename='text.dat')
    target = '<0123456789>'
    for i in range(10):
        msg, box = b.get()
        assert msg == target, '%s != %s' % (msg, target)

    # write
    b = Blue(filename='junk', mode='wb')
    b.put(target, 2)
    b = Blue(filename='junk')
    got, box = b.get()
    assert box == 2
    assert got == target, '%s != %s' % (got, target)
    b = Blue(filename='num.dat')

    # type
    b = TypeBlue(filename='junk', mode='wb')
    b.put(target)
    b.put(1)
    b.put(False)
    b = TypeBlue(filename='junk')
    got = b.get()
    assert got == target
    got = b.get()
    assert got == 1
    got = b.get()
    assert got == False

    Test that the formats are consistant by reading and writing
    to a file.  No real bluetooth required.
    
recipes/Python/498085_Lego_Mindstorms_Bluetooth/recipe-498085.py