本文整理汇总了Python中feature.Feature.is_enabled方法的典型用法代码示例。如果您正苦于以下问题:Python Feature.is_enabled方法的具体用法?Python Feature.is_enabled怎么用?Python Feature.is_enabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类feature.Feature
的用法示例。
在下文中一共展示了Feature.is_enabled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestFeatureAPI
# 需要导入模块: from feature import Feature [as 别名]
# 或者: from feature.Feature import is_enabled [as 别名]
class TestFeatureAPI(TestCase):
def setUp(self):
self.feature = Feature("test_feature")
def test_features_disabled_by_default(self):
self.assertFalse(self.feature.is_enabled(fake_request()))
def test_can_enable_features(self):
request = fake_request()
self.feature.enable(request)
self.assertTrue(self.feature.is_enabled(request))
def test_can_disable_features(self):
request = fake_request()
self.feature.enable(request)
self.feature.disable(request)
self.assertFalse(self.feature.is_enabled(request))
def test_can_enable_two_features(self):
feature2 = Feature("second_test_feature")
request = fake_request()
self.feature.enable(request)
feature2.enable(request)
self.assertTrue(self.feature.is_enabled(request))
self.assertTrue(feature2.is_enabled(request))
示例2: test_can_enable_two_features
# 需要导入模块: from feature import Feature [as 别名]
# 或者: from feature.Feature import is_enabled [as 别名]
def test_can_enable_two_features(self):
feature2 = Feature("second_test_feature")
request = fake_request()
self.feature.enable(request)
feature2.enable(request)
self.assertTrue(self.feature.is_enabled(request))
self.assertTrue(feature2.is_enabled(request))