Ejemplo n.º 1
0
 def test_enable(self):
     fn = "FOO"
     func = Feature(fn, None, 50)
     func.enabled = False
     self.backend.add_functionality(func)
     self.backend.is_enabled(fn) | should.be_falsy()
     self.backend.enable(fn)
     self.backend.is_enabled(fn) | should.be_truthy()
Ejemplo n.º 2
0
 def test_enable(self):
     fn = "FOO"
     func = Feature(fn, None, 50)
     func.enabled = False
     self.backend.add_functionality(func)
     self.backend.is_enabled(fn) | should.be_falsy()
     self.backend.enable(fn)
     self.backend.is_enabled(fn) | should.be_truthy()
Ejemplo n.º 3
0
 def test_add_a_disabled_functionality_with_percentage(self):
     fn = "FOO"
     func = Feature(fn, None, 50)
     func.enabled = False
     self.backend.add_functionality(func)
     f = self.backend._get_functionality(fn)
     f.name | should.eql(fn)
     f.percentage | should.eql(50)
     f.enabled | should.be_falsy()
     self.backend._redis.smembers("rollout:users:FOO") | should.be_empty()
Ejemplo n.º 4
0
 def test_add_a_disabled_functionality_with_percentage(self):
     fn = "FOO"
     func = Feature(fn, None, 50)
     func.enabled = False
     self.backend.add_functionality(func)
     f = self.backend._get_functionality(fn)
     f.name | should.eql(fn)
     f.percentage | should.eql(50)
     f.enabled | should.be_falsy()
     self.backend._redis.smembers("rollout:users:FOO") | should.be_empty()
Ejemplo n.º 5
0
 def test_add_a_disabled_functionality_with_percentage(self):
     fn = "FOO"
     func = Feature(fn, None, 50)
     func.enabled = False
     self.backend.add_functionality(func)
     self.backend.get_functionalities() | should.have_len(1)
     f, users = self.backend._get_functionality(fn)
     f.name | should.eql(fn)
     f.percentage | should.eql(50)
     f.enabled | should.be_falsy()
     users | should.be_empty().and_array()
Ejemplo n.º 6
0
 def test_add_a_disabled_functionality_with_percentage(self):
     fn = "FOO"
     func = Feature(fn, None, 50)
     func.enabled = False
     self.backend.add_functionality(func)
     self.backend.get_functionalities() | should.have_len(1)
     f, users = self.backend._get_functionality(fn)
     f.name | should.eql(fn)
     f.percentage | should.eql(50)
     f.enabled | should.be_falsy()
     users | should.be_empty().and_array()
Ejemplo n.º 7
0
 def test_is_enabled_func_exists_but_is_disabled(self):
     fn = "FOO"
     func = Feature(fn, None, 50)
     func.enabled = False
     self.backend.add_functionality(func)
     self.backend.is_enabled(fn) | should.be_falsy()
Ejemplo n.º 8
0
 def test_is_enabled_func_exists_but_is_disabled(self):
     fn = "FOO"
     func = Feature(fn, None, 50)
     func.enabled = False
     self.backend.add_functionality(func)
     self.backend.is_enabled(fn) | should.be_falsy()