コード例 #1
0
ファイル: test_rediskvio.py プロジェクト: jhuapl-boss/spdb
    def test_get_missing_read_cache_keys_iso_above_res(self):
        """Test for querying for keys missing in the cache when asking for iso data but below res fork"""
        # Put some keys in the cache
        rkv = RedisKVIO(self.config_data)
        keys = rkv.generate_cached_cuboid_keys(self.resource, 6, [0], [34, 35, 36], iso=True)
        for k in keys:
            self.cache_client.set(k, "dummy")

        missing, cached, all_keys = rkv.get_missing_read_cache_keys(self.resource, 6, [0, 2], [33, 34, 35], iso=True)

        assert len(missing) == 4
        assert len(cached) == 2

        assert all_keys[cached[0]] == "CACHED-CUBOID&ISO&4&3&2&6&0&34"
        assert all_keys[cached[1]] == "CACHED-CUBOID&ISO&4&3&2&6&0&35"
コード例 #2
0
ファイル: test_rediskvio.py プロジェクト: jhuapl-boss/spdb
    def test_get_missing_read_cache_keys(self):
        """Test for querying for keys missing in the cache"""
        # Put some keys in the cache
        rkv = RedisKVIO(self.config_data)
        keys = rkv.generate_cached_cuboid_keys(self.resource, 2, [0], [34, 35, 36])
        for k in keys:
            self.cache_client.set(k, "dummy")

        missing, cached, all_keys = rkv.get_missing_read_cache_keys(self.resource, 2, [0, 2], [33, 34, 35])

        assert len(missing) == 4
        assert len(cached) == 2

        assert all_keys[cached[0]] == "CACHED-CUBOID&4&3&2&2&0&34"
        assert all_keys[cached[1]] == "CACHED-CUBOID&4&3&2&2&0&35"
コード例 #3
0
ファイル: test_rediskvio.py プロジェクト: neurodata/spdb-boss
    def test_get_missing_read_cache_keys(self):
        """Test for querying for keys missing in the cache"""
        # Put some keys in the cache
        rkv = RedisKVIO(self.config_data)
        keys = rkv.generate_cached_cuboid_keys(self.resource, 2, [0],
                                               [34, 35, 36])
        for k in keys:
            self.cache_client.set(k, "dummy")

        missing, cached, all_keys = rkv.get_missing_read_cache_keys(
            self.resource, 2, [0, 2], [33, 34, 35])

        assert len(missing) == 4
        assert len(cached) == 2

        assert all_keys[cached[0]] == "CACHED-CUBOID&4&3&2&2&0&34"
        assert all_keys[cached[1]] == "CACHED-CUBOID&4&3&2&2&0&35"
コード例 #4
0
ファイル: test_rediskvio.py プロジェクト: neurodata/spdb-boss
    def test_get_missing_read_cache_keys_iso_above_res(self):
        """Test for querying for keys missing in the cache when asking for iso data but below res fork"""
        # Put some keys in the cache
        rkv = RedisKVIO(self.config_data)
        keys = rkv.generate_cached_cuboid_keys(self.resource,
                                               6, [0], [34, 35, 36],
                                               iso=True)
        for k in keys:
            self.cache_client.set(k, "dummy")

        missing, cached, all_keys = rkv.get_missing_read_cache_keys(
            self.resource, 6, [0, 2], [33, 34, 35], iso=True)

        assert len(missing) == 4
        assert len(cached) == 2

        assert all_keys[cached[0]] == "CACHED-CUBOID&ISO&4&3&2&6&0&34"
        assert all_keys[cached[1]] == "CACHED-CUBOID&ISO&4&3&2&6&0&35"