Beispiel #1
0
 def testSimpleDifferenceSecondFileWithExtraAttrib(self):
     self.assertEquals(
         1,
         JsonDiffTool.Json_Diff_Check_Keyword(
             'testinput/setTwoNames.json',
             'testinput/setTwoNamesExtraAttrib.json', '', ''),
         'failed! (expected 1 differences)')
Beispiel #2
0
 def testEqualFilesWithChangedAttributeOrder(self):
     """
     Attributes in different order. It's not a difference
     """
     self.assertEquals(
         0,
         JsonDiffTool.Json_Diff_Check_Keyword(
             'testinput/setTwoNames.json',
             'testinput/setTwoNamesReversed.json', '', ''),
         'failed! (expected 0 differences)')
Beispiel #3
0
 def testSimpleDifferenceCountingWithoutFiltering(self):
     """
     Identical documents
     """
     self.assertEquals(
         0,
         JsonDiffTool.Json_Diff_Check_Keyword(
             'testinput/arrayTwoNames.json',
             'testinput/arrayTwoNamesCopy.json', '', ''),
         'failed! (expected 0 differences)')
Beispiel #4
0
 def testEqualFilesWithScrambledArrayOrder(self):
     """
     This is moving an array element from one position to other. RFC 6902 describes this as "moving
     a value", but this jsonpatch implementation constructs a patch using remove + add. Acceptable though
     """
     self.assertEquals(
         2,
         JsonDiffTool.Json_Diff_Check_Keyword(
             'testinput/arrayTwoNames.json',
             'testinput/arrayTwoNamesReversed.json', '', ''),
         'failed! (expected 2 differences)')