Ejemplo n.º 1
0
def test_1_per_page(demo_app):
    """
    Make sure that asking for one thing only gives you the first
    """
    result = JobsApi().dispatch_request()
    assert len(result.data) == 1
    assert result.data[0]["id"] is not None
    assert result.data[0]["status"] == JobStatus.NOT_STARTED.value
    assert result.data[0].get("values") is None
Ejemplo n.º 2
0
def test_create_job_bob(demo_app):
    """
    Test that a job is created
    """
    result = JobsApi().dispatch_request()
    assert result["job_id"] is not None
Ejemplo n.º 3
0
def test_per_page(demo_app):
    """
    Make sure you get multiple jobs if you ask without limiting
    """
    result = JobsApi().dispatch_request()
    assert len(result.data) == 2
Ejemplo n.º 4
0
def test_per_page_end(demo_app):
    """
    Test that going of the end of pages still works
    """
    result = JobsApi().dispatch_request()
    assert len(result.data) == 0
Ejemplo n.º 5
0
def test_per_page_string(demo_app):
    """
    Test that giving a string to per page fails
    """
    with raises(HTTPException):
        JobsApi().dispatch_request()