def testReadableVersionExtraneous(self): """Test weird cases just return the version number as is.""" self.assertEqual( managed_memory_store.ParseReadableVersion('redis.8'), 'redis.8') self.assertEqual( managed_memory_store.ParseReadableVersion('redis 9_7_5'), 'redis 9_7_5')
def GetResourceMetadata(self): """Returns a dict containing metadata about the cache. Returns: dict mapping string property key to value. """ result = { 'cloud_redis_failover_style': self.failover_style, 'cloud_redis_region': self.redis_region, 'cloud_redis_azure_tier': self.azure_tier, 'cloud_redis_azure_redis_size': self.azure_redis_size, 'cloud_redis_version': managed_memory_store.ParseReadableVersion(self.redis_version), } return result
def GetResourceMetadata(self): """Returns a dict containing metadata about the instance. Returns: dict mapping string property key to value. """ result = { 'cloud_redis_failover_style': self.failover_style, 'cloud_redis_version': managed_memory_store.ParseReadableVersion(self.version), 'cloud_redis_node_type': self.node_type, 'cloud_redis_region': self.redis_region, 'cloud_redis_primary_zone': self.spec.vms[0].zone, 'cloud_redis_failover_zone': self.failover_zone, } return result
def testReadableVersion(self): """Test normal cases work as they should.""" self.assertEqual( managed_memory_store.ParseReadableVersion('6.x'), '6.x') self.assertEqual( managed_memory_store.ParseReadableVersion('4.0.10'), '4.0')