-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update settings, tests/ and the example implementation of bsmp/
- Loading branch information
1 parent
1f7e223
commit 14af122
Showing
20 changed files
with
156 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
[mypy] | ||
allow_redefinition = False | ||
ignore_missing_imports = True | ||
show_error_codes = True | ||
strict_equality = True | ||
explicit_package_bases = True | ||
ignore_missing_imports = True | ||
namespace_packages = True | ||
scripts_are_modules = True | ||
show_error_codes = True | ||
warn_unused_configs = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
pyserial==3.5 | ||
numpy | ||
matplotlib | ||
numpy | ||
pyserial==3.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
from .info import __author__, __version__, __date__ | ||
from .pydrs import SerialDRS | ||
|
||
__author__ = "" | ||
__version__ = "0.0.1" | ||
__date__ = "" | ||
|
||
__all__ = ["__author__", "__version__", "__date__", "SerialDRS"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
from .command import CommonPSBSMP | ||
from .interface import SerialInterface | ||
from .entities import EntitiesPS, Parameter, Parameters | ||
from .interface import SerialInterface | ||
|
||
__all__ = ["CommonPSBSMP", "SerialInterface", "EntitiesPS", "Parameter", "Parameters"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
__author__ = "" | ||
__version__ = "0.0.1" | ||
__date__ = "" | ||
|
||
__all__ = ["__author__", "__version__", "__date__"] |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from unittest import TestCase | ||
|
||
from siriuspy.pwrsupply.bsmp.constants import ConstPSBSMP | ||
|
||
from pydrs.bsmp import CommonPSBSMP, EntitiesPS, SerialInterface | ||
|
||
|
||
class TestSerialCommandsx0(TestCase): | ||
"""Test BSMP consulting methods.""" | ||
|
||
def setUp(self): | ||
"""Common setup for all tests.""" | ||
|
||
self._serial = SerialInterface(path="/serial", baudrate=9600) | ||
self._entities = EntitiesPS() | ||
|
||
self._pwrsupply = CommonPSBSMP( | ||
iointerface=self._serial, entities=self._entities, slave_address=1 | ||
) | ||
|
||
def test_query_protocol_version(self): | ||
"""Test""" | ||
|
||
def test_query_variable(self): | ||
"""Test""" | ||
self._pwrsupply.pread_variable(var_id=ConstPSBSMP.V_PS_STATUS, timeout=500) | ||
|
||
def test_query_parameter(self): | ||
"""Test""" | ||
self._pwrsupply.parameter_read(var_id=ConstPSBSMP.P_PS_NAME, timeout=500) | ||
|
||
def test_write_parameter(self): | ||
"""Test""" | ||
self._pwrsupply.parameter_write( | ||
var_id=ConstPSBSMP.P_PS_NAME, value="pv_test_name", timeout=500 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,26 @@ | ||
"""Test commands module.""" | ||
|
||
# import struct | ||
from unittest import TestCase | ||
|
||
# from unittest.mock import Mock | ||
|
||
from pydrs.bsmp import SerialInterface, CommonPSBSMP, EntitiesPS | ||
from siriuspy.pwrsupply.bsmp.constants import ConstPSBSMP | ||
from serial.serialutil import SerialException | ||
|
||
|
||
class TestSerialCommandsx0(TestCase): | ||
"""Test BSMP consulting methods.""" | ||
from pydrs.bsmp import SerialInterface | ||
|
||
def setUp(self): | ||
"""Common setup for all tests.""" | ||
|
||
self._serial = SerialInterface(path="/serial", baudrate=9600) | ||
self._entities = EntitiesPS() | ||
class TestSerialInterface(TestCase): | ||
def test_serial_creation(self): | ||
with self.assertRaises(SerialException): | ||
SerialInterface(path="/serial", baudrate=9600, auto_connect=True) | ||
|
||
self._pwrsupply = CommonPSBSMP( | ||
iointerface=self._serial, entities=self._entities, slave_address=1 | ||
) | ||
with self.assertRaises(TypeError): | ||
SerialInterface() | ||
|
||
def test_query_protocol_version(self): | ||
"""Test""" | ||
with self.assertRaises(ValueError): | ||
SerialInterface(path=None, baudrate=None) | ||
|
||
def test_query_variable(self): | ||
"""Test""" | ||
self._pwrsupply.pread_variable(var_id=ConstPSBSMP.V_PS_STATUS, timeout=500) | ||
def test_serial_write(self): | ||
raise NotImplementedError() | ||
|
||
def test_query_parameter(self): | ||
"""Test""" | ||
self._pwrsupply.parameter_read(var_id=ConstPSBSMP.P_PS_NAME, timeout=500) | ||
def test_serial_read(self): | ||
raise NotImplementedError() | ||
|
||
def test_write_parameter(self): | ||
"""Test""" | ||
self._pwrsupply.parameter_write( | ||
var_id=ConstPSBSMP.P_PS_NAME, value="pv_test_name", timeout=500 | ||
) | ||
def test_serial_request(self): | ||
raise NotImplementedError() |