Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

board_type in cfg setup #254

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions spinnaker_graph_front_end/config_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ def setup_configs():
:py:func:`~spinnaker_graph_front_end.setup` is called.
"""
clear_cfg_files(False)
add_spinnaker_cfg() # This add its dependencies too
add_spinnaker_cfg(board_type=None) # This add its dependencies too
set_cfg_files(
config_file=CONFIG_FILE_NAME,
default=os.path.join(os.path.dirname(__file__), CONFIG_FILE_NAME))
FecDataWriter.mock()


def unittest_setup():
def unittest_setup(*, board_type=None):
"""
Does all the steps that may be required before a unit test.

Expand All @@ -56,7 +56,17 @@ def unittest_setup():
.. note::
This file should only be called from spinnaker_graph_front_end tests
that do not call :py:func:`~spinnaker_graph_front_end.setup`.

.. note::
This file should only be called from sPyNNaker tests
that do not call `sim.setup`

:param board_type: Value to say how to confuire the system.
This includes defining what a VirtualMachine would be
Can be 1 for Spin1 boards, 2 for Spin2 boards or
None if the test do not depend on knowing the board type.
:type board_type: None or int
"""
clear_cfg_files(True)
add_spinnaker_cfg() # This add its dependencies too
add_default_cfg(os.path.join(os.path.dirname(__file__), CONFIG_FILE_NAME))
add_spinnaker_cfg(board_type) # This add its dependencies too