Python Unittest Example

Some time ago, I applied for a software QA position and was given this assignment:

Problem

Given 2 input files with rows in the format:

Write a python script to print:

  • All accounts in the first file not in the second
  • All accounts in the second file not in first
  • All accounts in both files with inconsistent data
  • Incomplete rows
  • All accounts in both with consistent data

Solution

Let us assume the first data file is as follows:

and the second data file is as follows:

Here is the python code:

Tags:

Add a Comment

Your email address will not be published. Required fields are marked *