Update test_flags.py

This commit is contained in:
Adam Butterworth
2020-04-13 16:42:18 -04:00
parent 2459382fe3
commit e9e1715bd0

View File

@@ -102,11 +102,10 @@ class ExperimentWaffleFlagTests(SharedModuleStoreTestCase):
(False, 1),
)
@ddt.unpack
def test_bucket_override(self, active, expected_bucket):
def test_forcing_bucket(self, active, expected_bucket):
bucket_flag = CourseWaffleFlag('experiments', 'test.0')
with bucket_flag.override(active=active):
self.assertEqual(self.flag.get_bucket(), expected_bucket)
self.assertEqual(self.flag.is_experiment_on(), active)
self.assertEqual(self.get_bucket(), expected_bucket)
def test_tracking(self):
# Run twice, with same request
@@ -152,6 +151,7 @@ class ExperimentWaffleFlagTests(SharedModuleStoreTestCase):
(False, 0, 0),
)
@ddt.unpack
# Test the override method
def test_override_method(self, active, bucket_override, expected_bucket):
with self.flag.override(active=active, bucket=bucket_override):
self.assertEqual(self.flag.get_bucket(), expected_bucket)