Space Python Loading Python…

Test the pipeline

Write the codeHard 2 stages

The telemetry pipeline from "Telemetry pipeline" has been split into small functions, ready for the ground station to run unattended. Before it goes live, the team wants tests: whoever changes the pipeline next must find out at once if something broke.

Write them. The hidden tests plant three bugs, one at a time, and your tests must catch every one.

Write assert checks for parse_row(): a good row becomes exactly the right reading, with the value as a number, and a row from an unknown sensor raises ValueError. Then print:

All checks passed

Leave the functions as they are. The hidden tests plant two bugs in parse_row(): one keeps the value as text, the other drops the sensor check. Your checks must fail on both.

Checks that pass
Checks that catch the bugs

Finish stage 1 to unlock this stage.

Add checks for check_limits(): a reading above its range, one below, and one exactly at the upper limit, which is allowed and must give None. Keep the passed line at the end.

The hidden tests now plant all three bugs, the third being >= instead of > in check_limits().

Checks that pass
Checks that catch all three bugs
You're not logged in, so your progress is kept in this browser only. Log in to save it, and to use hints and solutions.

Hints

script.py
PythonLn 1, Col 1Spaces: 4
Loading the Python environment…

Separate arguments with commas. They're passed on every Run as sys.argv[1:].