コード例 #1
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)
コード例 #2
0
 def test_multiple_keys(self):
     value = {'win': True, 'mac': True, 'default': False}
     assert process_configured_value('test', value) == value
コード例 #3
0
 def test_compound_keys(self):
     value = {'win,nightly': True, 'default': False}
     assert process_configured_value('test', value) == value
コード例 #4
0
 def test_simple_key(self):
     value = {'nightly': True, 'default': False}
     assert process_configured_value('test', value) == value
コード例 #5
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)
コード例 #6
0
 def test_multiple_keys(self):
     value = {"win": True, "mac": True, "default": False}
     assert process_configured_value("test", value) == value
コード例 #7
0
 def test_expands_single_values(self):
     for value in [True, False, 2, 'features']:
         assert process_configured_value('test', value) == {
             'default': value
         }
コード例 #8
0
 def test_compound_keys(self):
     value = {"win,nightly": True, "default": False}
     assert process_configured_value("test", value) == value
コード例 #9
0
 def test_simple_key(self):
     value = {"nightly": True, "default": False}
     assert process_configured_value("test", value) == value
コード例 #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)
コード例 #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)
コード例 #12
0
 def test_expands_single_values(self):
     for value in [True, False, 2, "features"]:
         assert process_configured_value("test", value) == {"default": value}