mirror of
https://github.com/meshtastic/python.git
synced 2025-12-28 18:37:52 -05:00
51
README.md
51
README.md
@@ -187,12 +187,45 @@ pip3 install .
|
||||
pytest
|
||||
```
|
||||
Possible options for testing:
|
||||
* For more verbosity, add "-v" or even "-vv" like this: pytest -vv
|
||||
* To run just unit tests: pytest -munit
|
||||
* To run just integration tests: pytest -mint
|
||||
* To run a smoke test with only one device connected serially: pytest -msmoke1
|
||||
CAUTION: Running smoke1 will reset values on the device.
|
||||
Be sure to hit the button on the device to reset after the test is run.
|
||||
* To run a specific test: pytest -msmoke1 meshtastic/test/test_smoke1.py::test_smoke1_info
|
||||
* To add another classification of tests, then look in pytest.ini
|
||||
* To see the unit test code coverage: pytest --cov=meshtastic
|
||||
* For more verbosity, add "-v" or even "-vv" like this:
|
||||
|
||||
```
|
||||
pytest -vv
|
||||
```
|
||||
|
||||
* To run just unit tests:
|
||||
|
||||
```
|
||||
pytest
|
||||
# or (more verbosely)
|
||||
pytest -m unit
|
||||
```
|
||||
|
||||
* To run just integration tests:
|
||||
|
||||
```
|
||||
pytest -m int
|
||||
```
|
||||
|
||||
* To run the smoke test with only one device connected serially:
|
||||
|
||||
```
|
||||
pytest -m smoke1
|
||||
```
|
||||
|
||||
CAUTION: Running smoke1 will reset values on the device, including the region to 1 (US).
|
||||
Be sure to hit the reset button on the device after the test is completed.
|
||||
|
||||
* To run a specific test:
|
||||
|
||||
```
|
||||
pytest -msmoke1 meshtastic/test/test_smoke1.py::test_smoke1_info
|
||||
```
|
||||
|
||||
* To add another classification of tests such as "unit" or "smoke1", see [pytest.ini](pytest.ini).
|
||||
|
||||
* To see the unit test code coverage:
|
||||
|
||||
```
|
||||
pytest --cov=meshtastic
|
||||
```
|
||||
|
||||
@@ -136,23 +136,18 @@ class Node:
|
||||
def deleteChannel(self, channelIndex):
|
||||
"""Delete the specifed channelIndex and shift other channels up"""
|
||||
ch = self.channels[channelIndex]
|
||||
print('ch:', ch, ' channelIndex:', channelIndex)
|
||||
if ch.role != channel_pb2.Channel.Role.SECONDARY:
|
||||
raise Exception("Only SECONDARY channels can be deleted")
|
||||
|
||||
# we are careful here because if we move the "admin" channel the channelIndex we need to use
|
||||
# for sending admin channels will also change
|
||||
adminIndex = self.iface.localNode._getAdminChannelIndex()
|
||||
print('adminIndex:', adminIndex)
|
||||
|
||||
self.channels.pop(channelIndex)
|
||||
print('channelIndex:', channelIndex)
|
||||
self._fixupChannels() # expand back to 8 channels
|
||||
|
||||
index = channelIndex
|
||||
print('max_channels:', self.iface.myInfo.max_channels)
|
||||
while index < self.iface.myInfo.max_channels:
|
||||
print('index:', index)
|
||||
self.writeChannel(index, adminIndex=adminIndex)
|
||||
index += 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user