Ejemplo n.º 1
0
def test_delete_queue():
    result = snippets.delete_queue(
        TEST_PROJECT_ID, TEST_LOCATION, QUEUE_NAME_1)
    assert result is None

    result = snippets.delete_queue(
        TEST_PROJECT_ID, TEST_LOCATION, QUEUE_NAME_2)
    assert result is None
def test_delete_queue():
    result = snippets.delete_queue(TEST_PROJECT_ID, TEST_LOCATION,
                                   QUEUE_NAME_1)
    if result is not None:
        raise AssertionError

    result = snippets.delete_queue(TEST_PROJECT_ID, TEST_LOCATION,
                                   QUEUE_NAME_2)
    if result is not None:
        raise AssertionError
Ejemplo n.º 3
0
def test_retry_task():
    QUEUE_SIZE = 3
    QUEUE_NAME = []
    for i in range(QUEUE_SIZE):
        QUEUE_NAME.append("queue-{}".format(uuid.uuid4()))

    name = "projects/{}/locations/{}/queues/{}".format(TEST_PROJECT_ID,
                                                       TEST_LOCATION,
                                                       QUEUE_NAME[2])
    result = snippets.retry_task(TEST_PROJECT_ID, TEST_LOCATION, QUEUE_NAME[0],
                                 QUEUE_NAME[1], QUEUE_NAME[2])
    assert name in result.name

    for i in range(QUEUE_SIZE):
        snippets.delete_queue(project=TEST_PROJECT_ID,
                              location=TEST_LOCATION,
                              queue=QUEUE_NAME[i])