Lines Matching refs:proto
19 def AddToModel(self, proto):
20 self.model._entries[proto.id_string] = proto
45 proto = sync_pb2.SyncEntity()
46 proto.id_string = 'abcd'
47 proto.version = 0
48 self.assertFalse(self.model._ItemExists(proto.id_string))
49 self.model._SaveEntry(proto)
50 self.assertEqual(1, proto.version)
51 self.assertTrue(self.model._ItemExists(proto.id_string))
52 self.model._SaveEntry(proto)
53 self.assertEqual(2, proto.version)
54 proto.version = 0
55 self.assertTrue(self.model._ItemExists(proto.id_string))
56 self.assertEqual(2, self.model._entries[proto.id_string].version)
60 proto = sync_pb2.SyncEntity()
61 proto.id_string = id_string
62 proto.position_in_parent = position
63 proto.parent_id_string = parent
64 self.AddToModel(proto)
231 proto = sync_pb2.SyncEntity()
233 proto.version = original.version
234 proto.id_string = original.id_string
235 proto.parent_id_string = original.parent_id_string
236 proto.name = original.name
238 proto.id_string = id_string
239 proto.version = 0
240 proto.specifics.CopyFrom(specifics)
242 proto.name = name
244 proto.parent_id_string = parent.id_string
246 proto.insert_after_item_id = prev.id_string
248 proto.insert_after_item_id = ''
249 proto.folder = True
250 proto.deleted = False
251 result = self.model.CommitEntry(proto, my_cache_guid, commit_session)
253 return (proto, result)