コード例 #1
0
 def testSetPropertyIndexed(self):
   property = datastore.Property()
   helper.set_property(property, 'a', 1)
   self.assertEquals(False, property.value.HasField('indexed'))
   helper.set_property(property, 'a', 1, indexed=True)
   self.assertEquals(False, property.value.HasField('indexed'))
   self.assertEquals(True, property.value.indexed)
   helper.set_property(property, 'a', 1, indexed=False)
   self.assertEquals(True, property.value.HasField('indexed'))
   self.assertEquals(False, property.value.indexed)
コード例 #2
0
 def testSetPropertyIndexed(self):
     property = datastore.Property()
     helper.set_property(property, 'a', 1)
     self.assertEquals(False, property.value.HasField('indexed'))
     helper.set_property(property, 'a', 1, indexed=True)
     self.assertEquals(False, property.value.HasField('indexed'))
     self.assertEquals(True, property.value.indexed)
     helper.set_property(property, 'a', 1, indexed=False)
     self.assertEquals(True, property.value.HasField('indexed'))
     self.assertEquals(False, property.value.indexed)
コード例 #3
0
 def testSetPropertyOverwrite(self):
   property = datastore.Property()
   helper.set_property(property, 'a', 1, indexed=False)
   helper.set_property(property, 'a', 'a')
   self.assertEquals('a', helper.get_value(property.value))
   self.assertEquals(True, property.value.indexed)
コード例 #4
0
 def testSetPropertyOverwrite(self):
     property = datastore.Property()
     helper.set_property(property, 'a', 1, indexed=False)
     helper.set_property(property, 'a', 'a')
     self.assertEquals('a', helper.get_value(property.value))
     self.assertEquals(True, property.value.indexed)