Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

METAR Reader Test Cases

Goal

The goal is to create Robot Framework test cases using copilot when the starting point is only some sample data.

Exericses

1. Use copilot to see what the data folder contains

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.


2. Implement MetarReader.py based on tests/test_metarreader.py

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.


3. Implement Robot Framework tests based on functional requirements

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 be 6.
  • Can Find Entry

    • Initially, the site KCPW should not exist.
    • Expect an error when checking if the site KCPW exists.
    • After adding data from metar_data.txt, the site KCPW should exist.
    • Expect an error when checking if the site KCPW does not exist.
  • 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 at KFKA.
    • Expect an error when checking if it should rain at MYEG.
  • Get Remarks

    • Expect an error when checking if the site KEHY has a precipitation sensor.
    • Expect an error when checking if the site KFDW has a precipitation sensor.
    • After adding data from metar_data.txt, the site KEHY should have a precipitation sensor.
    • Expect an error when checking if the site KFDW has a precipitation sensor.