add more tests; refactor due to pylint suggestion

This commit is contained in:
Mike Kinney
2021-12-10 20:02:01 -08:00
parent ce794ee035
commit 691801fca0
2 changed files with 201 additions and 7 deletions

View File

@@ -83,7 +83,7 @@ class Node:
def deleteChannel(self, channelIndex):
"""Delete the specifed channelIndex and shift other channels up"""
ch = self.channels[channelIndex]
if ch.role != channel_pb2.Channel.Role.SECONDARY:
if ch.role not in (channel_pb2.Channel.Role.SECONDARY, channel_pb2.Channel.Role.DISABLED):
our_exit("Warning: Only SECONDARY channels can be deleted")
# we are careful here because if we move the "admin" channel the channelIndex we need to use