Back to index

plone3  3.1.7
Public Member Functions
CMFDiffTool.tests.testFieldDiff.TestFieldDiff Class Reference

List of all members.

Public Member Functions

def testInterface
def testAttributeSame
def testMethodSame
def testAttributeDiff
def testMethodDiff
def testGetLineDiffsSame
def testGetLineDiffsDifferent
def testSameText
def testDiffText

Detailed Description

Test the FieldDiff class

Definition at line 20 of file testFieldDiff.py.


Member Function Documentation

Test attribute with different value

Definition at line 40 of file testFieldDiff.py.

00040 
00041     def testAttributeDiff(self):
00042         """Test attribute with different value"""
00043         a = A()
00044         b = B()
00045         fd = FieldDiff(a, b, 'attribute')
00046         self.failIf(fd.same)

Test attribute with same value

Definition at line 28 of file testFieldDiff.py.

00028 
00029     def testAttributeSame(self):
00030         """Test attribute with same value"""
00031         a = A()
00032         fd = FieldDiff(a, a, 'attribute')
00033         self.failUnless(fd.same)

Test text diff output with different value

Definition at line 75 of file testFieldDiff.py.

00075 
00076     def testDiffText(self):
00077         """Test text diff output with different value"""
00078         a = A()
00079         b = B()
00080         expected = "- value\n+ different value"
00081         fd = FieldDiff(a, b, 'attribute')
00082         self.assertEqual(fd.ndiff(), expected)

test getLineDiffs() method with different value

Definition at line 61 of file testFieldDiff.py.

00061 
00062     def testGetLineDiffsDifferent(self):
00063         """test getLineDiffs() method with different value"""
00064         a = A()
00065         b = B()
00066         fd = FieldDiff(a, b, 'attribute')
00067         expected = [('replace', 0, 1, 0, 1)]
00068         self.assertEqual(fd.getLineDiffs(), expected)
        
test getLineDiffs() method with same value

Definition at line 54 of file testFieldDiff.py.

00054 
00055     def testGetLineDiffsSame(self):
00056         """test getLineDiffs() method with same value"""
00057         a = A()
00058         fd = FieldDiff(a, a, 'attribute')
00059         expected = [('equal', 0, 1, 0, 1)]
00060         self.assertEqual(fd.getLineDiffs(), expected)

Ensure that tool instances implement the portal_diff interface

Definition at line 23 of file testFieldDiff.py.

00023 
00024     def testInterface(self):
00025         """Ensure that tool instances implement the portal_diff interface"""
00026         from Products.CMFDiffTool.interfaces.portal_diff import IDifference
00027         self.failUnless(IDifference.isImplementedByInstancesOf(FieldDiff))
    
Test method with different value

Definition at line 47 of file testFieldDiff.py.

00047 
00048     def testMethodDiff(self):
00049         """Test method with different value"""
00050         a = A()
00051         b = B()
00052         fd = FieldDiff(a, b, 'method')
00053         self.failIf(fd.same)

Test method with same value

Definition at line 34 of file testFieldDiff.py.

00034 
00035     def testMethodSame(self):
00036         """Test method with same value"""
00037         a = A()
00038         fd = FieldDiff(a, a, 'method')
00039         self.failUnless(fd.same)

Test text diff output with same value

Definition at line 69 of file testFieldDiff.py.

00069 
00070     def testSameText(self):
00071         """Test text diff output with same value"""
00072         a = A()
00073         fd = FieldDiff(a, a, 'attribute')
00074         self.assertEqual(fd.ndiff(), '  value')


The documentation for this class was generated from the following file: