blynkkk / lib-python

Blynk IoT library for Python and Micropython
MIT License
238 stars 82 forks source link

test(wildcard): Updated Wildcard Tests to include V0 #7

Closed BradenM closed 5 years ago

BradenM commented 5 years ago

Commit 4bd673b causes read/write wildcard tests to fail, as it allows a nonexistent virtual pin 33 to be passed to a wildcard decorator.

This fixes the two wildcard tests that were failing. All passed on this branch.

antohaUa commented 5 years ago

Hi BradenM! Range function takes right limit as N+1 value. Please check such code: for i in range(10): print(i)

This will give you 0-9 digits. So for me all looks correct - we can handle VPins 0-32 as expected

BradenM commented 5 years ago

@antohaUa

Haha your right, my mistake. Had read the failed test logs as if 33 pins were being passed rather than 33 events. Thanks for catching me on that one though, just wasn't thinking.

Anyways, I reverted my original change and updated the tests properly. Now they pass and should pass!

BradenM commented 5 years ago

For reference, here's there failed test log (same error for both read/write wildcard tests):

_____________________ TestBlynk.test_write_wildcard_event ______________________
        assert 'write v5' in bl._events.keys()
>       assert len(bl._events.keys()) == bl.VPIN_MAX_NUM
E       assert 33 == 32
E         -33
E         +32
antohaUa commented 5 years ago

Thanks you for corrected tests - I forgot that they should be corrected too ))