Exemplo n.º 1
0
 def test_toggle(self):
     fn = "FOO"
     self.backend.add_functionality(Feature(fn))
     self.backend.is_enabled(fn) | should.be_truthy()
     self.backend.toggle(fn)
     self.backend.is_enabled(fn) | should.be_falsy()
     self.backend.toggle(fn)
     self.backend.is_enabled(fn) | should.be_truthy()
Exemplo n.º 2
0
 def test_toggle(self):
     fn = "FOO"
     self.backend.add_functionality(Feature(fn))
     self.backend.is_enabled(fn) | should.be_truthy()
     self.backend.toggle(fn)
     self.backend.is_enabled(fn) | should.be_falsy()
     self.backend.toggle(fn)
     self.backend.is_enabled(fn) | should.be_truthy()
Exemplo n.º 3
0
 def test_is_enabled_func_in_an_user_with_an_enabled_rule_that_matches(
         self):
     fn = "FOO"
     func = Feature(fn, None, 0)
     self.backend.add_functionality(func)
     self.backend.set_rule(fn, re.compile(r"00$"))
     self.backend.is_enabled(fn, "4400") | should.be_truthy()
Exemplo n.º 4
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()
Exemplo n.º 5
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()
Exemplo n.º 6
0
 def test_is_enabled_func_in_an_user_added(self):
     fn = "FOO"
     func = Feature(fn, None, 0)
     self.backend.add_functionality(func)
     self.backend.add(fn, "bar")
     self.backend.is_enabled(fn, "bar") | should.be_truthy()
Exemplo n.º 7
0
 def test_is_enabled_func_in_an_user_not_added_but_percentage_is_100(self):
     fn = "FOO"
     func = Feature(fn, None, 100)
     self.backend.add_functionality(func)
     self.backend.is_enabled(fn, "bar") | should.be_truthy()
Exemplo n.º 8
0
 def test_is_enabled_func_exists(self):
     fn = "FOO"
     self.backend.add_functionality(Feature(fn))
     self.backend.is_enabled(fn) | should.be_truthy()
Exemplo n.º 9
0
 def test_is_enabled_func_in_an_user_with_an_enabled_rule_that_matches(self):
     fn = "FOO"
     func = Feature(fn, None, 0)
     self.backend.add_functionality(func)
     self.backend.set_rule(fn, re.compile(r"00$"))
     self.backend.is_enabled(fn, "4400") | should.be_truthy()
Exemplo n.º 10
0
 def test_is_enabled_func_in_an_user_added(self):
     fn = "FOO"
     func = Feature(fn, None, 0)
     self.backend.add_functionality(func)
     self.backend.add(fn, "bar")
     self.backend.is_enabled(fn, "bar") | should.be_truthy()
Exemplo n.º 11
0
 def test_is_enabled_func_in_an_user_not_added_but_percentage_is_100(self):
     fn = "FOO"
     func = Feature(fn, None, 100)
     self.backend.add_functionality(func)
     self.backend.is_enabled(fn, "bar") | should.be_truthy()
Exemplo n.º 12
0
 def test_is_enabled_func_exists(self):
     fn = "FOO"
     self.backend.add_functionality(Feature(fn))
     self.backend.is_enabled(fn) | should.be_truthy()