def testGetValueForDatastore(self):
    e = TestEntity()
    self.assertEquals(None, TestEntity.json_property.get_value_for_datastore(e))
    e.json_property = TestJsonType(5)
    self.assertEquals(
        u'{"size": 5}', TestEntity.json_property.get_value_for_datastore(e))

    e.empty_json_property = EmptyDictJsonType()
    self.assertEquals(
        None, TestEntity.empty_json_property.get_value_for_datastore(e))
Test get_value_for_datastore method.
dataset/ETHPy150Open GoogleCloudPlatform/appengine-mapreduce/python/test/mapreduce/json_util_test.py/JsonPropertyTest.testGetValueForDatastore