def test_invalid_keys_rejected(self):
     with self.assertRaises(FeatureGateException) as context:
         assert process_configured_value('test', {
             'default': True,
             'bogus': True
         })
     assert 'Unexpected target bogus' in str(context.exception)
 def test_multiple_keys(self):
     value = {'win': True, 'mac': True, 'default': False}
     assert process_configured_value('test', value) == value
 def test_compound_keys(self):
     value = {'win,nightly': True, 'default': False}
     assert process_configured_value('test', value) == value
 def test_simple_key(self):
     value = {'nightly': True, 'default': False}
     assert process_configured_value('test', value) == value
 def test_default_key_is_required(self):
     with self.assertRaises(FeatureGateException) as context:
         assert process_configured_value('test', {'nightly': True})
     assert 'has no default' in str(context.exception)
Exemple #6
0
 def test_multiple_keys(self):
     value = {"win": True, "mac": True, "default": False}
     assert process_configured_value("test", value) == value
 def test_expands_single_values(self):
     for value in [True, False, 2, 'features']:
         assert process_configured_value('test', value) == {
             'default': value
         }
Exemple #8
0
 def test_compound_keys(self):
     value = {"win,nightly": True, "default": False}
     assert process_configured_value("test", value) == value
Exemple #9
0
 def test_simple_key(self):
     value = {"nightly": True, "default": False}
     assert process_configured_value("test", value) == value
Exemple #10
0
 def test_invalid_keys_rejected(self):
     with self.assertRaises(FeatureGateException) as context:
         assert process_configured_value("test", {"default": True, "bogus": True})
     assert "Unexpected target bogus" in str(context.exception)
Exemple #11
0
 def test_default_key_is_required(self):
     with self.assertRaises(FeatureGateException) as context:
         assert process_configured_value("test", {"nightly": True})
     assert "has no default" in str(context.exception)
Exemple #12
0
 def test_expands_single_values(self):
     for value in [True, False, 2, "features"]:
         assert process_configured_value("test", value) == {"default": value}