Skip to content

Latest commit

 

History

History
46 lines (28 loc) · 1.91 KB

File metadata and controls

46 lines (28 loc) · 1.91 KB

Testing

Overview

The function we tested most thoroughly was is_valid_country from the DataframeAnalyzer class. The tests for this function are located in the file test_data_frame_analyzer_is_valid_country.py.

Testing Approach

We employed a rigorous approach to test the is_valid_country function, attempting to break it in various ways by providing a range of edge case inputs. Our goal was to ensure the function handled all potential scenarios correctly.

Edge Case Inputs

  1. Case Sensitivity:

    • Tested if the method is case sensitive.
  2. Whitespace Handling:

    • Checked if the function can differentiate between country names with and without blank spaces.
  3. Special Characters:

    • Verified if the function can distinguish between valid country names and those with special characters.
  4. Input Types:

    • Provided inputs of various types (integers, floats, None, and empty strings) to see how the function handles non-string inputs.
  5. Validity Check:

    • Tested with a mix of valid and invalid country names to confirm the function’s accuracy.

Expected Issues

We anticipated that the function might produce unexpected results in the following scenarios:

  • Input is not a string.
  • Input contains blank spaces.
  • Input contains special characters.
  • Input is empty or None.

Results

The is_valid_country function performed as expected across all test cases, correctly identifying valid and invalid country names and handling edge cases appropriately.

Additional Testing

We also added tests for another function in the same file, test_data_frame_analyzer_is_valid_country.py. These additional tests confirmed that the second function behaved as expected.

Conclusion

Our comprehensive testing ensures that the is_valid_country function of the DataframeAnalyzer class is robust and reliable, capable of handling a wide range of input scenarios correctly.