Esempio n. 1
0
 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)
Esempio n. 2
0
 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()
Esempio n. 3
0
 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()
Esempio n. 4
0
 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()
Esempio n. 5
0
 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)
Esempio n. 6
0
 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)