def testMainSample05(self): """Test Case: Valid command-line arguments using the relative error flag and sample05 files""" A, B, relative_error = self.setUpSample05() returned = jsondiff.main() self.assertEqual(returned, None)
def testMainInvalidFlags(self): """Test Case: Invalid command-line arguments where both the --rel_tol and --abs_tol flags are used and raises ValueError""" A, B = self.setUpTwoFlags() with self.assertRaises(ValueError): jsondiff.main()
def testMainInvalidExtension(self): """Test Case: An invalid extension is provided. Raises TypeError because expect .json extension, .py provided""" A, B, relative_error = self.setUpInvalidExtensionRelativeError() with self.assertRaises(TypeError): jsondiff.main()
def testMainInvalidPaths(self): """Test Case: Invalid command-line arguments where the paths for both files are invalid""" A, B, relative_error = self.setUpInvalidPathRelativeError() with self.assertRaises(FileNotFoundError): jsondiff.main()
def testMainValidAbsoluteErrorNoDifference(self): """Test Case: Valid command-line arguments using absolute error and the same json file""" A, B, absolute_error = self.setUpValidAbsoluteErrorNoDifference() returned = jsondiff.main() self.assertEqual(returned, None)
def testMainValidRelativeErrorDifference(self): """Test Case: Valid command-line arguments using relative error and different json files""" A, B, relative_error = self.setUpValidRelativeError() returned = jsondiff.main() self.assertEqual(returned, None)