Exemple #1
0
def test_reports_request_serializes_datetime(Session):
    s = Session.return_value
    r = Reports("api_token")

    r.details(workspace_id=42, when=date(2001, 1, 31))

    s.get.assert_called_once_with("details", workspace_id=42, user_agent=Reports.USER_AGENT, when="2001-01-31")
Exemple #2
0
def test_reports_request_serializes_datetime(Session):
    s = Session.return_value
    r = Reports('api_token')

    r.details(workspace_id=42, when=date(2001, 1, 31))

    s.get.assert_called_once_with('details',
                                  workspace_id=42,
                                  user_agent=Reports.USER_AGENT,
                                  when='2001-01-31')
Exemple #3
0
def test_reports_request_requires_workspace():
    r = Reports(None)

    with pytest.raises(ValueError):
        r.details()
Exemple #4
0
def test_reports_request_requires_workspace():
    r = Reports(None)

    with pytest.raises(ValueError):
        r.details()