def test_cached(m_get_aws_conn, setup):
    req = mock.Mock()
    req.id = "id-1"
    m_get_aws_conn.return_value. \
        get_all_spot_instance_requests.return_value = [req]
    get_spot_request("region-1", "id-1")
    get_spot_request("region-1", "id-1")
    m_get_aws_conn.assert_called_once_with("region-1")
def test_cached(m_get_aws_conn, setup):
    req = mock.Mock()
    req.id = "id-1"
    m_get_aws_conn.return_value. \
        get_all_spot_instance_requests.return_value = [req]
    get_spot_request("region-1", "id-1")
    get_spot_request("region-1", "id-1")
    m_get_aws_conn.assert_called_once_with("region-1")
def test_not_cached(m_populate_spot_requests_cache, setup):
    get_spot_request("region-1", "id-1")
    m_populate_spot_requests_cache.assert_called_once_with("region-1")
def test_not_cached(m_populate_spot_requests_cache, setup):
    get_spot_request("region-1", "id-1")
    m_populate_spot_requests_cache.assert_called_once_with("region-1")