コード例 #1
0
def test_delete_channels(capsys, pochan):
    notification_channel_id = pochan.notification_channel.name.split('/')[-1]
    snippets.delete_notification_channels(
        pochan.project_name, [notification_channel_id], force=True)
    out, _ = capsys.readouterr()
    assert "{0} deleted".format(notification_channel_id) in out
    pochan.notification_channel.name = ''   # So teardown is not tried
コード例 #2
0
def test_delete_channels(capsys, pochan):
    notification_channel_id = pochan.notification_channel.name.split('/')[-1]
    snippets.delete_notification_channels(
        pochan.project_name, [notification_channel_id], force=True)
    out, _ = capsys.readouterr()
    assert "{0} deleted".format(notification_channel_id) in out
    pochan.notification_channel.name = ''   # So teardown is not tried
コード例 #3
0
def test_delete_channels(capsys, pochan):
    notification_channel_id = pochan.notification_channel.name.split('/')[-1]

    # This sleep call is for mitigating the following error:
    # "409 Too many concurrent edits to the project configuration.
    # Please try again."
    # Having multiple projects will void these `sleep()` calls.
    # See also #3310
    time.sleep(2)
    snippets.delete_notification_channels(pochan.project_name,
                                          [notification_channel_id],
                                          force=True)
    out, _ = capsys.readouterr()
    assert "{0} deleted".format(notification_channel_id) in out
    pochan.notification_channel.name = ''  # So teardown is not tried
コード例 #4
0
 def invoke_delete():
     snippets.delete_notification_channels(pochan.project_name,
                                           [notification_channel_id],
                                           force=True)