File: test_timers_client.py

package info (click to toggle)
python-globus-sdk 4.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,172 kB
  • sloc: python: 35,227; sh: 44; makefile: 35
file content (25 lines) | stat: -rw-r--r-- 708 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import pytest

import globus_sdk


def test_create_job_rejects_transfer_timer():
    client = globus_sdk.TimersClient()
    payload = globus_sdk.TransferTimer(schedule={"type": "once"}, body={})

    with pytest.raises(
        globus_sdk.GlobusSDKUsageError,
        match=r"Cannot pass a TransferTimer to create_job\(\)\.",
    ):
        client.create_job(payload)


def test_create_timer_rejects_timer_job():
    client = globus_sdk.TimersClient()
    payload = globus_sdk.TimerJob("https://bogus", {}, "2021-01-01T00:00:00Z", 300)

    with pytest.raises(
        globus_sdk.GlobusSDKUsageError,
        match=r"Cannot pass a TimerJob to create_timer\(\)\.",
    ):
        client.create_timer(payload)