def test_request(get_proxies, init_session):
    """
    The request to get branch info is issued.
    """
    config = Mock(base_url="www.example.com", branch_info_url="https://www.example.com/branch_info")

    connection = InsightsConnection(config)
    connection.get = MagicMock()
    connection.get_branch_info()

    connection.get.assert_called_once_with(config.branch_info_url)
Example #2
0
def test_request(get_proxies, init_session):
    """
    The request to get branch info is issued with correct timeout set.
    """
    config = Mock(base_url="www.example.com",
                  branch_info_url="https://www.example.com/branch_info")

    connection = InsightsConnection(config)
    connection.get_branch_info()

    init_session.return_value.get.assert_called_once_with(
        config.branch_info_url, timeout=config.http_timeout)