Time Limit: 90 Minutes Topic: Python Fundamentals, Logic & Test Driven Development (TDD)
Welcome to the System Check assessment. You have been tasked with building the logic for a Flight Ticket Parser and a Nuclear Reactor Safety Monitor.
This is an invigilated assessment. You are required to demonstrate not just your ability to write code, but your ability to write tests for that code.
system_check.py📝 (EDIT THIS)- This file contains the empty functions you need to complete.
- Do not rename any functions or the file itself.
test_reactor.py🆕 (CREATE THIS)- You must create this file from scratch.
- This file will contain the Unit Tests for Question 5.
Open system_check.py. You will need to parse string data from flight tickets.
- Warning: The data is not always the same length! You cannot use fixed indices (e.g.,
text[0:5]). You must logically find the hyphens-.
Implement the logic for determining a Leap Year. This requires nested or chained modulo (%) operators.
This section requires Test Driven Development (TDD).
- Read the requirements for
reactor_statusinsystem_check.py. - BEFORE you write the logic, create a new file named
test_reactor.py. - Implement the
TestReactorclass and write tests for all scenarios (Critical, Warning, Normal, etc.). - Once your tests are written, go back to
system_check.pyand write the code to pass them.
To verify your Reactor Logic, run your test file:
python test_reactor.py