Closed jamesleesaunders closed 8 years ago
@jamesleesaunders: All of these were small so it's easy enough here, but I would prefer for each PR to fix only one issue. That way we don't hold up any features from getting merged while discussing others that may not be quite ready.
Thanks again for the contributions!
@jamesleesaunders: I actually reverted this as the unit test that you modified didn't pass on Travis CI.
I added Travis CI between the time that you created the PR and merging it so I wasn't able to see the failed results until after I merged. The next PR will run those tests right away so we will know before merging.
Cool, no worries I will try to keep code changes small and linked to only one feature / fix.
Sorry the test failed and you had to revert it. I have now also attached Travis CI to my repo so can check before hand. I am still a little confused as the reason I made that test_zigbee.pl test change is because the test was failing when I ran it on the command line (perhaps I am doing it wrong?):
MacBook-Pro:tests jim$ pwd
/Users/jim/hive/python-xbee/xbee/tests
MacBook-Pro:tests jim$ sudo python -m unittest test_zigbee
Password:
.F.........
======================================================================
FAIL: test_parse_dio_adc_supply_voltage_not_clamped (test_zigbee.TestParseZigBeeIOData)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test_zigbee.py", line 248, in test_parse_dio_adc_supply_voltage_not_clamped
self.assertEqual(results, expected_results)
AssertionError: Lists differ: [{'adc-7': 280}] != [{'adc-7': 3352}]
First differing element 0:
{'adc-7': 280}
{'adc-7': 3352}
- [{'adc-7': 280}]
? --
+ [{'adc-7': 3352}]
? +++
----------------------------------------------------------------------
Ran 11 tests in 0.002s
FAILED (failures=1)
MacBook-Pro:tests jim$
Which is why I modified the test from:
expected_results = [{'adc-7':0xD18}]
to:
expected_results = [{'adc-7':280}]
Perhaps I am running these tests in the wrong way as I also notice test_base.py fails in eve more a dramatic manner:
MacBook-Pro:tests jim$ sudo python -m unittest test_base
EE....EEEEEE
======================================================================
ERROR: test_provide_callback (test_base.TestAsyncCallback)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test_base.py", line 167, in test_provide_callback
error_callback=self.error_callback)
File "/Library/Python/2.7/site-packages/xbee/base.py", line 79, in __init__
self.start()
...
...
RuntimeError: maximum recursion depth exceeded in cmp
======================================================================
ERROR: test_provide_callback (test_base.TestAsyncCallback)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test_base.py", line 159, in tearDown
self.xbee.halt()
AttributeError: 'NoneType' object has no attribute 'halt'
...
======================================================================
ERROR: test_read (test_base.TestReadFromDevice)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test_base.py", line 74, in test_read
frame = xbee._wait_for_frame()
File "/Library/Python/2.7/site-packages/xbee/base.py", line 212, in _wait_for_frame
byte = self.serial.read()
AttributeError: 'NoneType' object has no attribute 'read'
...
======================================================================
ERROR: test_write (test_base.TestWriteToDevice)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test_base.py", line 28, in test_write
xbee._write(b'\x00')
File "/Library/Python/2.7/site-packages/xbee/base.py", line 123, in _write
self.serial.write(frame)
AttributeError: 'NoneType' object has no attribute 'write'
----------------------------------------------------------------------
Ran 11 tests in 0.005s
FAILED (failures=8)
MacBook-Pro:tests jim$
Should I be running these a different way?
Ah, ha! Ignore the failed tests I mentioned in the previous comment. I started afresh with a newly checked out version and installed afresh and all is now well :-)
Sorry again for the confusion.
This PR has been raised to fix a few little niggles: