示例#1
0
 def test_batch_with_deletion(self):
     delete_with_reversion(self.new_author)
     add_versions_to_batch(self.batch, changed_items())
     serialized = serialize_batch(self.key.decode('hex'), self.batch)
     with self.assertRaises(ObjectDoesNotExist):
         process_batch(self.key.decode('hex'), serialized['batch'],
                       serialized['iv'])
示例#2
0
 def test_batch_with_deletion(self):
     delete_with_reversion(self.new_author)
     add_versions_to_batch(self.batch, changed_items())
     serialized = serialize_batch(self.key.decode('hex'), self.batch)
     with self.assertRaises(ObjectDoesNotExist):
         process_batch(self.key.decode('hex'),
                       serialized['batch'],
                       serialized['iv'])
示例#3
0
def push_test_batch():
    """
    pushes empty batch to server to test settings and returns True on success
    """
    try:
        key = settings.NUDGE_KEY.decode('hex')
        response = send_command('batch/', serialize_batch(key, Batch()))
        return False if response.getcode() != 200 else True
    except:
        return False
示例#4
0
 def test_batch_with_deletion(self):
     delete_with_reversion(self.new_author)
     add_versions_to_batch(self.batch, changed_items())
     serialized= serialize_batch(self.key.decode('hex'),self.batch)
     with self.assertRaises(ObjectDoesNotExist): # because it doesn't exist anymore in this database
         processed_batch=process_batch(self.key.decode('hex'), serialized['batch'], serialized['iv'])
示例#5
0
 def test_batch_serialization_and_processing(self):
     add_versions_to_batch(self.batch, changed_items())
     serialized= serialize_batch(self.key.decode('hex'),self.batch)
     processed_batch=process_batch(self.key.decode('hex'), serialized['batch'], serialized['iv'])
示例#6
0
 def test_batch_serialization_and_processing(self):
     add_versions_to_batch(self.batch, changed_items())
     serialized = serialize_batch(self.key.decode('hex'), self.batch)
     process_batch(self.key.decode('hex'),
                   serialized['batch'],
                   serialized['iv'])