Esempio n. 1
0
 def test_returns_default_scopes_if_none_given(self):
     id_to_scope = scoping.get_id_to_scope_with_defaults()
     self.assertEqual({scoping.SINGLETON, scoping.PROTOTYPE},
                      set(id_to_scope.keys()))
Esempio n. 2
0
 def test_returns_default_scopes_if_none_given(self):
     id_to_scope = scoping.get_id_to_scope_with_defaults()
     self.assertEqual(set([scoping.SINGLETON, scoping.PROTOTYPE]),
                      set(id_to_scope.keys()))
Esempio n. 3
0
 def test_adds_default_scopes_to_given_scopes(self):
     orig_id_to_scope = {'a-scope-id': 'a-scope'}
     id_to_scope = scoping.get_id_to_scope_with_defaults(orig_id_to_scope)
     self.assertEqual('a-scope', id_to_scope['a-scope-id'])
     self.assertIn(scoping.SINGLETON, id_to_scope)
     self.assertIn(scoping.PROTOTYPE, id_to_scope)
Esempio n. 4
0
 def test_adds_default_scopes_to_given_scopes(self):
     orig_id_to_scope = {'a-scope-id': 'a-scope'}
     id_to_scope = scoping.get_id_to_scope_with_defaults(orig_id_to_scope)
     self.assertEqual('a-scope', id_to_scope['a-scope-id'])
     self.assertIn(scoping.SINGLETON, id_to_scope)
     self.assertIn(scoping.PROTOTYPE, id_to_scope)