Exemplo n.º 1
0
 def test_class_plugins_config(self):
     option = 'anyblok.tests.test_config:MockPluginClass'
     Configuration.configuration['option'] = ConfigOption(
         option, AnyBlokPlugin)
     res = Configuration.get('option')
     self.assertIs(MockPluginClass, res)
Exemplo n.º 2
0
 def test_wrong_plugins_config(self):
     option = 'anyblok.tests.test_config:MockPluginWrong'
     with self.assertRaises(ImportError):
         Configuration.configuration['option'] = ConfigOption(
             option, AnyBlokPlugin)
Exemplo n.º 3
0
 def test_get(self):
     option = 'My option'
     Configuration.configuration['option'] = ConfigOption(option, str)
     res = Configuration.get('option')
     self.assertEqual(option, res)
Exemplo n.º 4
0
 def test_has(self):
     self.assertFalse(Configuration.has('option'))
     Configuration.configuration['option'] = ConfigOption('option', str)
     self.assertTrue(Configuration.has('option'))
Exemplo n.º 5
0
 def test_fnct_plugins_config(self):
     option = 'anyblok.tests.test_config:MockPluginFnct'
     Configuration.configuration['option'] = ConfigOption(
         option, AnyBlokPlugin)
     res = Configuration.get('option')
     assert MockPluginFnct is res
Exemplo n.º 6
0
 def test_get(self):
     option = 'My option'
     Configuration.configuration['option'] = ConfigOption(option, str)
     res = Configuration.get('option')
     assert option == res
Exemplo n.º 7
0
 def test_has(self):
     assert Configuration.has('option') is False
     Configuration.configuration['option'] = ConfigOption('option', str)
     assert Configuration.has('option') is True