本文整理汇总了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)
示例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)
示例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']))
示例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"]))