Commit 04827fb8 authored by Łukasz Nowak's avatar Łukasz Nowak

Start testing promise_slapos_module_id_generator alarm.

parent df685c22
# Copyright (c) 2002-2012 Nexedi SA and Contributors. All Rights Reserved.
import transaction
from Products.SlapOS.tests.testSlapOSMixin import \
testSlapOSMixin
class TestSlapOSCorePromiseSlapOSModuleIdGeneratorAlarm(testSlapOSMixin):
def test_Module_assertIdGenerator(self):
module = self.portal.newContent(portal_type='Person Module',
id=str(self.generateNewId()),
id_generator='bad_id_generator')
self.assertEqual('bad_id_generator', module.getIdGenerator())
# check positive response
self.assertTrue(module.Module_assertIdGenerator('bad_id_generator', False))
self.assertEqual('bad_id_generator', module.getIdGenerator())
self.assertTrue(module.Module_assertIdGenerator('bad_id_generator', True))
self.assertEqual('bad_id_generator', module.getIdGenerator())
# check negative response and that no-op run does not modify
self.assertFalse(module.Module_assertIdGenerator('good_id_generator', False))
self.assertEqual('bad_id_generator', module.getIdGenerator())
# check negative response with fixit request
self.assertFalse(module.Module_assertIdGenerator('good_id_generator', True))
self.assertEqual('good_id_generator', module.getIdGenerator())
self.assertTrue(module.Module_assertIdGenerator('good_id_generator', False))
self.assertEqual('good_id_generator', module.getIdGenerator())
transaction.abort()
189
\ No newline at end of file
190
\ No newline at end of file
......@@ -3,6 +3,7 @@ testSlapOSCoreComputerSlapInterfaceWorkflow
testSlapOSCoreConstraint
testSlapOSCoreInstanceSlapInterfaceWorkflow
testSlapOSCorePersonSlapInterfaceWorkflow
testSlapOSCorePromiseSlapOSModuleIdGeneratorAlarm
testSlapOSCoreSlapOSAllocateInstanceAlarm
testSlapOSCoreSlapOSCloudInteractionWorkflow
testSlapOSShadow
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment