Example #1
0
 def testFields(self):
   op = ops.Operation(ops.WAVELET_SET_TITLE, 'opid02',
                      {'waveId': 'wavelet-id',
                       'title': 'a title'})
   self.assertEqual(ops.WAVELET_SET_TITLE, op.method)
   self.assertEqual('opid02', op.id)
   self.assertEqual(2, len(op.params))
 def testDefaults(self):
     op = ops.Operation(ops.WAVELET_APPEND_BLIP, 'wave-id', 'wavelet-id')
     self.assertEquals(ops.WAVELET_APPEND_BLIP, op.type)
     self.assertEquals('wave-id', op.wave_id)
     self.assertEquals('wavelet-id', op.wavelet_id)
     self.assertEquals('', op.blip_id)
     self.assertEquals(-1, op.index)
     self.assertEquals(None, op.property)
Example #3
0
 def testFields(self):
   op = ops.Operation(ops.DOCUMENT_INSERT, 'wave-id', 'wavelet-id',
                      blip_id='blip-id',
                      index=1,
                      prop='foo')
   self.assertEquals(ops.DOCUMENT_INSERT, op.type)
   self.assertEquals('wave-id', op.wave_id)
   self.assertEquals('wavelet-id', op.wavelet_id)
   self.assertEquals('blip-id', op.blip_id)
   self.assertEquals(1, op.index)
   self.assertEquals('foo', op.property)