The goal is to create Robot Framework test cases using copilot when the starting point is only some sample data.
Take a look at the data folder and ask copilot to explain what it contains. See how
copilot can identify the contents and parse it for you using just the sample data.
The MetarReader library needs to satisfy the following functional requirements:
-
Data Management
- The system should read METAR data from a file and store it internally.
- Each METAR entry should be associated with a unique site identifier.
- The system should count the number of unique sites.
-
Site Existence
- The system should check if a site exists.
- The system should check if a site does not exist.
- If a site is expected to exist but does not, the system should raise an error.
- If a site is expected not to exist but does, the system should raise an error.
-
Precipitation Check
- The system should check if it is raining at a specific site.
- If it is expected to rain at a site but does not, the system should raise an error.
- If it is not expected to rain at a site but does, the system should raise an error.
-
Remarks Handling
- The system should retrieve remarks for a specific site.
- If remarks are expected for a site but do not exist, the system should raise an error.
- If remarks are not expected for a site but exist, the system should raise an error.
- The system should check if a site has a specific remark (e.g., "AO2" for precipitation sensor).
The unit tests for the MetarReader library are already implemented in
tests/test_metarreader.py. Once your library is ready, the unit tests should pass.
To increase readability of the library, ensure the methods that are intended to be keywords
have the robot.api.deco.keyword decorator.
The Robot Framework test suite metar_test.robot must test the following cases:
-
METAR File Contains Data
- Initially, the number of sites should be
0. - After adding data from
metar_data.txt, the number of sites should be6.
- Initially, the number of sites should be
-
Can Find Entry
- Initially, the site
KCPWshould not exist. - Expect an error when checking if the site
KCPWexists. - After adding data from metar_data.txt, the site
KCPWshould exist. - Expect an error when checking if the site
KCPWdoes not exist.
- Initially, the site
-
Can Check for Rain
- Expect an error when checking if it should rain at
MYEG. - Expect an error when checking if it should rain at
KFKA. - After adding data from
metar_data.txt, it should rain atKFKA. - Expect an error when checking if it should rain at
MYEG.
- Expect an error when checking if it should rain at
-
Get Remarks
- Expect an error when checking if the site
KEHYhas a precipitation sensor. - Expect an error when checking if the site
KFDWhas a precipitation sensor. - After adding data from
metar_data.txt, the siteKEHYshould have a precipitation sensor. - Expect an error when checking if the site
KFDWhas a precipitation sensor.
- Expect an error when checking if the site