Esempio n. 1
0
def test_delete_saved_query(mocked_url, mocked_rw_apikey, mocked_account_resource_id, capsys):
    test_saved_query_id = str(uuid.uuid4())
    mocked_url.return_value = '', MOCK_API_URL
    mocked_rw_apikey.return_value = str(uuid.uuid4())
    mocked_account_resource_id.return_value = str(uuid.uuid4())
    httpretty.register_uri(httpretty.DELETE, MOCK_API_URL, status=204)

    api.delete_saved_query(test_saved_query_id)
    out, err = capsys.readouterr()

    assert "Deleted saved query with id: %s" % test_saved_query_id in out
Esempio n. 2
0
def test_delete_saved_query(mocked_url, mocked_rw_apikey, mocked_account_resource_id, capsys):
    test_saved_query_id = str(uuid.uuid4())
    mocked_url.return_value = '', MOCK_API_URL
    mocked_rw_apikey.return_value = str(uuid.uuid4())
    mocked_account_resource_id.return_value = str(uuid.uuid4())
    httpretty.register_uri(httpretty.DELETE, MOCK_API_URL, status=204)

    api.delete_saved_query(test_saved_query_id)
    out, err = capsys.readouterr()

    assert "Deleted saved query with id: %s" % test_saved_query_id in out
Esempio n. 3
0
def test_delete_saved_query(mocked_url, mocked_rw_apikey,
                            mocked_account_resource_id, capsys):
    test_saved_query_id = str(uuid.uuid4())
    mocked_url.return_value = misc_ex.MOCK_SAVED_QUERY_URL
    mocked_rw_apikey.return_value = misc_ex.TEST_APIKEY_WITH_VALID_LENGTH
    mocked_account_resource_id.return_value = misc_ex.TEST_ACCOUNT_RESOURCE_ID
    httpretty.register_uri(httpretty.DELETE,
                           misc_ex.MOCK_SAVED_QUERY_URL + "/" +
                           test_saved_query_id,
                           status=204)

    api.delete_saved_query(test_saved_query_id)
    out, err = capsys.readouterr()

    assert "Deleted saved query with id: %s" % test_saved_query_id in out
Esempio n. 4
0
def delete_saved_query(query_id):
    """Delete the saved query with given ID"""
    api.delete_saved_query(query_id)
Esempio n. 5
0
def delete_saved_query(query_id):
    """Delete the saved query with given ID"""
    api.delete_saved_query(query_id)