server/test/unittest_hook.py
changeset 9548 be001628edad
parent 8694 d901c36bcfce
child 9758 91f3cb7db2aa
equal deleted inserted replaced
9547:43aace16a953 9548:be001628edad
     1 # -*- coding: utf-8 -*-
     1 # -*- coding: utf-8 -*-
     2 # copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     2 # copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     3 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     3 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     4 #
     4 #
     5 # This file is part of CubicWeb.
     5 # This file is part of CubicWeb.
     6 #
     6 #
     7 # CubicWeb is free software: you can redistribute it and/or modify it under the
     7 # CubicWeb is free software: you can redistribute it and/or modify it under the
    59         self.assertEqual(session.pending_operations, [l3, l1, l2, l4])
    59         self.assertEqual(session.pending_operations, [l3, l1, l2, l4])
    60 
    60 
    61     @clean_session_ops
    61     @clean_session_ops
    62     def test_global_operation_order(self):
    62     def test_global_operation_order(self):
    63         session = self.session
    63         session = self.session
    64         op1 = integrity._DelayedDeleteOp(session)
    64         op1 = syncschema.RDefDelOp(session)
    65         op2 = syncschema.RDefDelOp(session)
    65         op2 = integrity._CheckORelationOp(session)
    66         # equivalent operation generated by op2 but replace it here by op3 so we
       
    67         # can check the result...
       
    68         op3 = syncschema.MemSchemaNotifyChanges(session)
    66         op3 = syncschema.MemSchemaNotifyChanges(session)
    69         op4 = integrity._DelayedDeleteOp(session)
    67         self.assertEqual([op1, op2, op3], session.pending_operations)
    70         op5 = integrity._CheckORelationOp(session)
       
    71         self.assertEqual(session.pending_operations, [op1, op2, op4, op5, op3])
       
    72 
       
    73 
    68 
    74 class HookCalled(Exception): pass
    69 class HookCalled(Exception): pass
    75 
    70 
    76 config = TestServerConfiguration('data')
    71 config = TestServerConfiguration('data')
    77 config.bootstrap_cubes()
    72 config.bootstrap_cubes()