Exemplo n.º 1
0
    def test_get_connection_params_no_need_for_connection(
            self, should_get_connection_params_mock):
        # arrange
        input_parser = Mock()
        should_get_connection_params_mock.return_value = False

        # act
        conn = BootstrapHelper.get_connection_params(input_parser)

        # assert
        self.assertIsNone(conn)
Exemplo n.º 2
0
    def test_get_connection_params_returns_connection(
            self, should_get_connection_params_mock,
            connection_provider_class_mock):
        # arrange
        input_parser = Mock()

        # act
        conn = BootstrapHelper.get_connection_params(input_parser)

        # assert
        self.assertEqual(
            conn, connection_provider_class_mock.return_value.get_connection.
            return_value)