Skip to content

Commit

Permalink
Move new test assets to own folder.
Browse files Browse the repository at this point in the history
  • Loading branch information
gpachecoNI committed Jun 29, 2023
1 parent 8b40568 commit 62d90ec
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 17 deletions.
21 changes: 7 additions & 14 deletions ni_measurementlink_generator/tests/acceptance/test_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def test___command_line_args___create_measurement_with_annotations___render_with
with pytest.raises(SystemExit):
template.create_measurement(
[
"Sample Measurement With Annotations",
"Sample Measurement",
"--measurement-version",
"1.2.3.4",
"--ui-file",
Expand All @@ -69,21 +69,14 @@ def test___command_line_args___create_measurement_with_annotations___render_with
]
)

golden_path = test_assets_directory / "example_renders"
golden_path = test_assets_directory / "example_renders" / "with_annotations"

filenames = [
"measurementWithAnnotations.py",
"SampleMeasurementWithAnnotations.serviceconfig",
"start.bat",
]
filenames = ["measurement.py", "SampleMeasurement.serviceconfig", "start.bat"]
for filename in filenames:
golden_file = golden_path / filename
# We always generate only measurement.py
if filename == "measurementWithAnnotations.py":
filename = "measurement.py"

_assert_equal(golden_file, temp_directory / filename)

_assert_equal(
golden_path / filename,
temp_directory / filename,
)

def _assert_equal(expected_path: pathlib.Path, result_path: pathlib.Path):
expected = expected_path.read_text()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"services": [
{
"displayName": "Sample Measurement With Annotations",
"displayName": "Sample Measurement",
"serviceClass": "SampleMeasurement_Python",
"descriptionUrl": "https://www.example.com/SampleMeasurement.html",
"providedInterfaces": [ "ni.measurementlink.measurement.v1.MeasurementService" ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

service_directory = pathlib.Path(__file__).resolve().parent
measurement_service = nims.MeasurementService(
service_config_path=service_directory / "SampleMeasurementWithAnnotations.serviceconfig",
service_config_path=service_directory / "SampleMeasurement.serviceconfig",
version="1.2.3.4",
ui_file_paths=[service_directory / "MeasurementUI.measui"],
)
Expand All @@ -30,7 +30,7 @@ def measure(array_input):
help="Enable verbose logging. Repeat to increase verbosity.",
)
def main(verbose: int) -> None:
"""Host the Sample Measurement With Annotations service."""
"""Host the Sample Measurement service."""
if verbose > 1:
level = logging.DEBUG
elif verbose == 1:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@echo off
REM The discovery service uses this script to start the measurement service.
REM You can customize this script for your Python setup. The -v option logs
REM messages with level INFO and above.

call python "%~dp0measurement.py" -v

0 comments on commit 62d90ec

Please sign in to comment.