当前位置: 首页>>代码示例>>Python>>正文


Python Experiment.load_alternatives方法代码示例

本文整理汇总了Python中sixpack.models.Experiment.load_alternatives方法的典型用法代码示例。如果您正苦于以下问题:Python Experiment.load_alternatives方法的具体用法?Python Experiment.load_alternatives怎么用?Python Experiment.load_alternatives使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sixpack.models.Experiment的用法示例。


在下文中一共展示了Experiment.load_alternatives方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_differing_alternatives_fails

# 需要导入模块: from sixpack.models import Experiment [as 别名]
# 或者: from sixpack.models.Experiment import load_alternatives [as 别名]
    def test_differing_alternatives_fails(self):
        exp = Experiment.find_or_create('load-differing-alts', ['yes', 'zack', 'PBR'], redis=self.redis)
        alts = Experiment.load_alternatives(exp.name, redis=self.redis)
        self.assertEqual(sorted(alts), sorted(['PBR', 'yes', 'zack']))

        with self.assertRaises(ValueError):
            exp = Experiment.find_or_create('load-differing-alts', ['kyle', 'zack', 'PBR'], redis=self.redis)
开发者ID:VPilitsyn,项目名称:sixpack,代码行数:9,代码来源:experiment_model_test.py

示例2: test_differing_alternatives_fails

# 需要导入模块: from sixpack.models import Experiment [as 别名]
# 或者: from sixpack.models.Experiment import load_alternatives [as 别名]
    def test_differing_alternatives_fails(self):
        exp = Experiment.find_or_create("load-differing-alts", ["yes", "zack", "PBR"], self.redis)
        alts = Experiment.load_alternatives(exp.name, self.redis)
        self.assertEqual(sorted(alts), sorted(["PBR", "yes", "zack"]))

        with self.assertRaises(ValueError):
            exp = Experiment.find_or_create("load-differing-alts", ["kyle", "zack", "PBR"], self.redis)
开发者ID:spil-bahadir,项目名称:sixpack,代码行数:9,代码来源:experiment_model_test.py

示例3: test_load_alternatives

# 需要导入模块: from sixpack.models import Experiment [as 别名]
# 或者: from sixpack.models.Experiment import load_alternatives [as 别名]
 def test_load_alternatives(self):
     exp = Experiment.find_or_create('load-alts-test', ['yes', 'no', 'call-me-maybe'], redis=self.redis)
     alts = Experiment.load_alternatives(exp.name, redis=self.redis)
     self.assertEqual(sorted(alts), sorted(['yes', 'no', 'call-me-maybe']))
开发者ID:VPilitsyn,项目名称:sixpack,代码行数:6,代码来源:experiment_model_test.py

示例4: test_load_alternatives

# 需要导入模块: from sixpack.models import Experiment [as 别名]
# 或者: from sixpack.models.Experiment import load_alternatives [as 别名]
 def test_load_alternatives(self):
     exp = Experiment.find_or_create("load-alts-test", ["yes", "no", "call-me-maybe"], self.redis)
     alts = Experiment.load_alternatives(exp.name, self.redis)
     self.assertEqual(sorted(alts), sorted(["yes", "no", "call-me-maybe"]))
开发者ID:spil-bahadir,项目名称:sixpack,代码行数:6,代码来源:experiment_model_test.py


注:本文中的sixpack.models.Experiment.load_alternatives方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。