Example #1
0
    def test_overrides_defaults_with_given_arguments(self):
        arguments = self._arguments_from(
            db_host="test-db-server",
            registry_port=1290)

        settings = Settings.from_arguments(arguments)

        self.assertEqual(len(DeepDiff(Settings.defaults(), settings)["values_changed"]), 2)
Example #2
0
 def setUp(self):
     self._settings = Settings.defaults()
     self._ui = MagicMock(UI)
     self._queue_factory = FakeQueueFactory()
     self._db_factory = FakeDBFactory()
     self._registry = MagicMock()
     self._storage = Storage(settings=self._settings,
                             ui=self._ui,
                             queue=self._queue_factory,
                             db=self._db_factory,
                             registry=lambda *args, **kwargs: self._registry)
     self._consumer = None
Example #3
0
 def test_uses_defaults_when_config_file_does_not_exist(self):
     arguments = self._arguments_from(
         configuration_file="does_not_exists.yml")
     settings = Settings.from_arguments(arguments)
     self.assertEqual(DeepDiff(Settings.defaults(), settings), {})
Example #4
0
 def test_uses_defaults_when_no_argument_is_given(self):
     arguments = self._arguments_from()
     settings = Settings.from_arguments(arguments)
     self.assertEqual(DeepDiff(Settings.defaults(), settings), {})
Example #5
0
 def setUp(self):
     self.settings = Settings.defaults()