예제 #1
0
파일: testUtils.py 프로젝트: Vinsurya/Plone
 def testAddTwoInterfacesAndRemoveOne(self):
     obj=Mock()
     addMarkerInterface(obj, MarkerInterface, SecondMarkerInterface)
     removeMarkerInterface(obj, MarkerInterface)
     self.assertEqual(self.ifaces(obj), ["SecondMarkerInterface"])
예제 #2
0
파일: field.py 프로젝트: Vinsurya/Plone
 def set(self, instance, value, **kwargs):
     if value:
         addMarkerInterface(instance, *self.interfaces)
     else:
         removeMarkerInterface(instance, *self.interfaces)
예제 #3
0
파일: testUtils.py 프로젝트: Vinsurya/Plone
 def testAddAndRemoveSingleInterface(self):
     obj=Mock()
     addMarkerInterface(obj, MarkerInterface)
     removeMarkerInterface(obj, MarkerInterface)
     self.assertEqual(self.ifaces(obj), [])
예제 #4
0
파일: testUtils.py 프로젝트: Vinsurya/Plone
 def testAddAdditionalInterface(self):
     obj=MockWithInterface()
     addMarkerInterface(obj, MarkerInterface)
     self.assertEqual(self.ifaces(obj),
         ["MarkerInterface", "BaseInterface"])
예제 #5
0
파일: testUtils.py 프로젝트: Vinsurya/Plone
 def testAddMultipleInterfaces(self):
     obj=Mock()
     addMarkerInterface(obj, MarkerInterface, SecondMarkerInterface)
     self.assertEqual(self.ifaces(obj),
         ["MarkerInterface", "SecondMarkerInterface"])
예제 #6
0
파일: testUtils.py 프로젝트: Vinsurya/Plone
 def testAddSingleInterface(self):
     obj=Mock()
     addMarkerInterface(obj, MarkerInterface)
     self.assertEqual(self.ifaces(obj), ["MarkerInterface"])
예제 #7
0
파일: testUtils.py 프로젝트: Vinsurya/Plone
 def testAddNothing(self):
     obj=Mock()
     addMarkerInterface(obj)
     self.assertEqual(self.ifaces(obj), [])