def test_shard_mapping_list_mappings(self): shard_mappings = ShardMapping.list("RANGE") self.assertTrue(ShardingUtils.compare_shard_mapping (self.__shard_mapping_1, shard_mappings[0])) self.assertTrue(ShardingUtils.compare_shard_mapping (self.__shard_mapping_2, shard_mappings[1])) self.assertTrue(ShardingUtils.compare_shard_mapping (self.__shard_mapping_3, shard_mappings[2])) self.assertTrue(ShardingUtils.compare_shard_mapping (self.__shard_mapping_4, shard_mappings[3]))
def test_fetch_shard_mapping(self): shard_mapping_1 = ShardMapping.fetch("db1.t1") shard_mapping_2 = ShardMapping.fetch("db2.t2") shard_mapping_3 = ShardMapping.fetch("db3.t3") shard_mapping_4 = ShardMapping.fetch("db4.t4") self.assertTrue(ShardingUtils.compare_shard_mapping (self.__shard_mapping_1, shard_mapping_1)) self.assertTrue(ShardingUtils.compare_shard_mapping (self.__shard_mapping_2, shard_mapping_2)) self.assertTrue(ShardingUtils.compare_shard_mapping (self.__shard_mapping_3, shard_mapping_3)) self.assertTrue(ShardingUtils.compare_shard_mapping (self.__shard_mapping_4, shard_mapping_4))
def test_shard_mapping_list_mappings(self): shard_mappings = ShardMapping.list("RANGE") self.assertTrue( ShardingUtils.compare_shard_mapping(self.__shard_mapping_1, shard_mappings[0])) self.assertTrue( ShardingUtils.compare_shard_mapping(self.__shard_mapping_2, shard_mappings[1])) self.assertTrue( ShardingUtils.compare_shard_mapping(self.__shard_mapping_3, shard_mappings[2])) self.assertTrue( ShardingUtils.compare_shard_mapping(self.__shard_mapping_4, shard_mappings[3]))
def test_shard_mapping_list_mappings(self): """Test the listing of all HASH shards in a shard mapping. """ shard_mappings = ShardMapping.list("HASH") self.assertTrue( ShardingUtils.compare_shard_mapping(self.__shard_mapping_1, shard_mappings[0]))
def test_fetch_shard_mapping(self): shard_mapping_1 = ShardMapping.fetch("db1.t1") shard_mapping_2 = ShardMapping.fetch("db2.t2") shard_mapping_3 = ShardMapping.fetch("db3.t3") shard_mapping_4 = ShardMapping.fetch("db4.t4") self.assertTrue( ShardingUtils.compare_shard_mapping(self.__shard_mapping_1, shard_mapping_1)) self.assertTrue( ShardingUtils.compare_shard_mapping(self.__shard_mapping_2, shard_mapping_2)) self.assertTrue( ShardingUtils.compare_shard_mapping(self.__shard_mapping_3, shard_mapping_3)) self.assertTrue( ShardingUtils.compare_shard_mapping(self.__shard_mapping_4, shard_mapping_4))
def test_shard_mapping_list_mappings(self): """Test the listing of all HASH shards in a shard mapping. """ shard_mappings = ShardMapping.list("HASH") self.assertTrue(ShardingUtils.compare_shard_mapping (self.__shard_mapping_1, shard_mappings[0]))