Skip to content

Commit

Permalink
Unit test friendly folder structure for Python parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
sea-bass committed Jan 11, 2025
1 parent 6d88bc2 commit 9b04476
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 2 deletions.
Empty file.
4 changes: 2 additions & 2 deletions example_python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# set module_name and yaml file
module_name = 'admittance_parameters'
yaml_file = 'generate_parameter_module_example/parameters.yaml'
validation_module = 'generate_parameter_module_example.custom_validation'
validation_module = 'validators.custom_validation'
generate_parameter_module(
module_name, yaml_file, validation_module=validation_module
)
Expand All @@ -33,7 +33,7 @@
tests_require=['pytest'],
entry_points={
'console_scripts': [
'test_node = generate_parameter_module_example.minimal_publisher:main'
'test_node = examples.minimal_publisher:main'
],
},
)
7 changes: 7 additions & 0 deletions example_python/test/test_parameters.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import generate_parameter_module_example
print(f'Imported file from: {generate_parameter_module_example.__file__}')
print('OK 1')

import generate_parameter_module_example.admittance_parameters # noqa: E402

print('OK 2')
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def generate_parameter_module(module_name, yaml_file, validation_module=''):
install_dir = os.path.join(
colcon_ws,
'install',
pkg_name,
'lib',
py_version,
'site-packages',
Expand Down

0 comments on commit 9b04476

Please # to comment.