Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(3)  |  Call(3)  |  Derive(0)  |  Import(0)
Retrieve a bucket key to compact using a Lua script.

src/t/u/turnstile-HEAD/tests/unit/test_compactor.py   turnstile(Download)
    def test_init(self, mock_debug):
        db = mock.Mock(**{'register_script.return_value': 'script_handle'})
        gbtbs = compactor.GetBucketKeyByScript({}, db)
 
        self.assertEqual(gbtbs.script, 'script_handle')
    def test_get_empty(self, mock_debug):
        script = mock.Mock(return_value=[])
        db = mock.Mock(**{'register_script.return_value': script})
        gbtbs = compactor.GetBucketKeyByScript({}, db)
 
    def test_get_nonempty(self, mock_debug):
        script = mock.Mock(return_value=['bucket1'])
        db = mock.Mock(**{'register_script.return_value': script})
        gbtbs = compactor.GetBucketKeyByScript({}, db)