當前位置: 首頁>>代碼示例>>Python>>正文


Python script.Script類代碼示例

本文整理匯總了Python中mockredis.script.Script的典型用法代碼示例。如果您正苦於以下問題:Python Script類的具體用法?Python Script怎麽用?Python Script使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Script類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_python_to_lua_none

 def test_python_to_lua_none(self):
     pval = None
     lval = MockRedisScript._python_to_lua(pval)
     is_null = """
     function is_null(var1)
         return var1 == nil
     end
     return is_null
     """
     lua_is_null = self.lua.execute(is_null)
     ok_(MockRedisScript._lua_to_python(lua_is_null(lval)))
開發者ID:RedisLabs,項目名稱:mockredis,代碼行數:11,代碼來源:test_script.py

示例2: test_lua_to_python_bool

 def test_lua_to_python_bool(self):
     lval = self.lua.eval("true")
     pval = MockRedisScript._lua_to_python(lval)
     ok_(isinstance(pval, bool))
     eq_(True, pval)
開發者ID:RedisLabs,項目名稱:mockredis,代碼行數:5,代碼來源:test_script.py

示例3: test_lua_to_python_string

 def test_lua_to_python_string(self):
     lval = self.lua.eval('"somestring"')
     pval = MockRedisScript._lua_to_python(lval)
     ok_(isinstance(pval, str))
     eq_("somestring", pval)
開發者ID:RedisLabs,項目名稱:mockredis,代碼行數:5,代碼來源:test_script.py

示例4: test_lua_to_python_flota

 def test_lua_to_python_flota(self):
     lval = self.lua.eval("22.2")
     pval = MockRedisScript._lua_to_python(lval)
     ok_(isinstance(pval, float))
     eq_(22.2, pval)
開發者ID:RedisLabs,項目名稱:mockredis,代碼行數:5,代碼來源:test_script.py

示例5: test_lua_to_python_long

 def test_lua_to_python_long(self):
     lval = self.lua.eval("22")
     pval = MockRedisScript._lua_to_python(lval)
     ok_(isinstance(pval, long))
     eq_(22, pval)
開發者ID:RedisLabs,項目名稱:mockredis,代碼行數:5,代碼來源:test_script.py

示例6: test_lua_to_python_list

 def test_lua_to_python_list(self):
     lval = self.lua.eval('{"val1", "val2"}')
     pval = MockredisScript._lua_to_python(lval)
     self.assertIsInstance(pval, list)
     self.assertEqual(["val1", "val2"], pval)
開發者ID:aim110,項目名稱:mockredis,代碼行數:5,代碼來源:test_script.py

示例7: test_python_to_lua_float

 def test_python_to_lua_float(self):
     pval = 10.1
     lval = MockRedisScript._python_to_lua(pval)
     lval_expected = self.lua.eval("10.1")
     eq_("number", self.lua_globals.type(lval))
     ok_(MockRedisScript._lua_to_python(self.lua_compare_val(lval_expected, lval)))
開發者ID:RedisLabs,項目名稱:mockredis,代碼行數:6,代碼來源:test_script.py

示例8: test_python_to_lua_list

 def test_python_to_lua_list(self):
     pval = ["abc", "xyz"]
     lval = MockRedisScript._python_to_lua(pval)
     lval_expected = self.lua.eval('{"abc", "xyz"}')
     self.lua_assert_equal_list(lval_expected, lval)
開發者ID:RedisLabs,項目名稱:mockredis,代碼行數:5,代碼來源:test_script.py

示例9: test_python_to_lua_long

 def test_python_to_lua_long(self):
     pval = long(10)
     lval = MockRedisScript._python_to_lua(pval)
     lval_expected = self.lua.eval('10')
     eq_("number", self.lua_globals.type(lval))
     ok_(MockRedisScript._lua_to_python(self.lua_compare_val(lval_expected, lval)))
開發者ID:asherf,項目名稱:mockredis,代碼行數:6,代碼來源:test_script.py

示例10: test_python_to_lua_boolean

 def test_python_to_lua_boolean(self):
     pval = True
     lval = MockredisScript._python_to_lua(pval)
     self.assertEqual("boolean", self.lua_globals.type(lval))
     self.assertTrue(MockredisScript._lua_to_python(lval))
開發者ID:aim110,項目名稱:mockredis,代碼行數:5,代碼來源:test_script.py

示例11: test_python_to_lua_float

 def test_python_to_lua_float(self):
     pval = 10.1
     lval = MockredisScript._python_to_lua(pval)
     lval_expected = self.lua.eval('10.1')
     self.assertEqual("number", self.lua_globals.type(lval))
     self.assertTrue(MockredisScript._lua_to_python(self.lua_compare_val(lval_expected, lval)))
開發者ID:aim110,項目名稱:mockredis,代碼行數:6,代碼來源:test_script.py

示例12: test_lua_to_python_bool

 def test_lua_to_python_bool(self):
     lval = self.lua.eval('true')
     pval = MockredisScript._lua_to_python(lval)
     self.assertIsInstance(pval, bool)
     self.assertEqual(True, pval)
開發者ID:aim110,項目名稱:mockredis,代碼行數:5,代碼來源:test_script.py

示例13: test_lua_to_python_string

 def test_lua_to_python_string(self):
     lval = self.lua.eval('"somestring"')
     pval = MockredisScript._lua_to_python(lval)
     self.assertIsInstance(pval, str)
     self.assertEqual("somestring", pval)
開發者ID:aim110,項目名稱:mockredis,代碼行數:5,代碼來源:test_script.py

示例14: test_lua_to_python_flota

 def test_lua_to_python_flota(self):
     lval = self.lua.eval('22.2')
     pval = MockredisScript._lua_to_python(lval)
     self.assertIsInstance(pval, float)
     self.assertEqual(22.2, pval)
開發者ID:aim110,項目名稱:mockredis,代碼行數:5,代碼來源:test_script.py

示例15: test_lua_to_python_long

 def test_lua_to_python_long(self):
     lval = self.lua.eval('22')
     pval = MockredisScript._lua_to_python(lval)
     self.assertIsInstance(pval, long)
     self.assertEqual(22, pval)
開發者ID:aim110,項目名稱:mockredis,代碼行數:5,代碼來源:test_script.py


注:本文中的mockredis.script.Script類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。