Esempio n. 1
0
 def test_verifying_missing_required_binding_raises_error(self):
     binding_mapping = bindings_lib.BindingMapping({}, {})
     self.assertRaises(errors.MissingRequiredBindingError,
                       binding_mapping.verify_requirements, [
                           required_bindings.RequiredBinding(
                               'unknown-binding-key', 'a-require-loc')
                       ])
Esempio n. 2
0
 def test_verifying_ok_bindings_passes(self):
     binding_mapping = bindings_lib.BindingMapping(
         {'a-binding-key': 'a-binding'}, {})
     binding_mapping.verify_requirements([
         required_bindings.RequiredBinding('a-binding-key',
                                           'unused-require-loc')
     ])
Esempio n. 3
0
 def test_verifying_conflicting_required_binding_raises_error(self):
     binding_mapping = bindings_lib.BindingMapping(
         {}, {'conflicting-binding-key': ['a-binding', 'another-binding']})
     self.assertRaises(
         errors.ConflictingRequiredBindingError,
         binding_mapping.verify_requirements, [
             required_bindings.RequiredBinding('conflicting-binding-key',
                                               'unused-require-loc')
         ])