# -*- coding: utf-8; -*- from wuttjamaican.testing import ConfigTestCase from wuttasync import conf as mod class TestWuttaSyncConfig(ConfigTestCase): def make_extension(self): return mod.WuttaSyncConfig() def test_default_import_handlers(self): # base config has no default handlers spec = self.config.get( "wuttasync.importing.import.to_wutta.from_wutta.default_handler" ) self.assertIsNone(spec) spec = self.config.get( "wuttasync.importing.export.to_wutta.from_wutta.default_handler" ) self.assertIsNone(spec) # extend config ext = self.make_extension() ext.configure(self.config) # config now has default handlers spec = self.config.get( "wuttasync.importing.import.to_wutta.from_wutta.default_handler" ) self.assertIsNotNone(spec) self.assertEqual(spec, "wuttasync.importing.wutta:FromWuttaToWuttaImport") spec = self.config.get( "wuttasync.importing.export.to_wutta.from_wutta.default_handler" ) self.assertIsNotNone(spec) self.assertEqual(spec, "wuttasync.importing.wutta:FromWuttaToWuttaExport")