1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #9715 from yegorich/pr/dist/tests/if_lib/cleanup

Pr/dist/tests/if lib/cleanup
This commit is contained in:
Kevin Weiss 2018-08-06 13:22:56 +02:00 committed by GitHub
commit 7a20a5ec46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 14 deletions

View File

@ -16,9 +16,6 @@ class BptIf(LLShell):
"""Getters and setters for the memory map."""
DEVICE_NUM = 0x42A5
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
def is_connected_to_board(self):
"""Checks if board is connected."""
return self.get_sys_device_num()["data"] == self.DEVICE_NUM

View File

@ -13,20 +13,20 @@ from .riot_driver import RiotDriver
def driver_from_config(dev_type='serial', *args, **kwargs):
"""Returns driver instance given configuration"""
if dev_type is 'serial':
if dev_type == 'serial':
return SerialDriver(*args, **kwargs)
elif dev_type is 'riot':
elif dev_type == 'riot':
return RiotDriver(*args, **kwargs)
elif dev_type is 'driver':
elif dev_type == 'driver':
return kwargs['driver']
raise NotImplementedError()
def available_configs(dev_type='serial', *args, **kwargs):
"""Returns possible configurations to attempt to connect to."""
if dev_type is 'serial':
if dev_type == 'serial':
return SerialDriver.get_configs(*args, **kwargs)
elif dev_type is 'riot':
elif dev_type == 'riot':
return RiotDriver.get_configs(*args, **kwargs)
raise NotImplementedError()

View File

@ -20,9 +20,6 @@ class DutShell(BaseDevice):
RESULT_ERROR = 'Error'
RESULT_TIMEOUT = 'Timeout'
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
@staticmethod
def _try_parse_data(data):
if ('[' in data) and (']' in data):

View File

@ -24,9 +24,6 @@ class LLShell(BaseDevice):
RESULT_ERROR = 'Error'
RESULT_TIMEOUT = 'Timeout'
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
@staticmethod
def _try_parse_data(data):
parsed_data = None