Ejemplo n.º 1
0
def test_stop_encoding_twice_fails(app):
    """Test if stopping the same job twice fails."""
    job_id = "1234-2345-abcd"

    # Stop encoding works for the first time...
    stop_encoding(job_id)
    # ... and fails for the second
    with pytest.raises(SorensonError):
        stop_encoding(job_id)
Ejemplo n.º 2
0
def test_stop_encoding_twice_fails(app):
    """Test if stopping the same job twice fails."""
    job_id = "1234-2345-abcd"

    # Stop encoding works for the first time...
    stop_encoding(job_id)
    # ... and fails for the second
    with pytest.raises(SorensonError):
        stop_encoding(job_id)
Ejemplo n.º 3
0
def test_stop_encoding(requests_delete_mock, app):
    """Test if stopping encoding works."""
    job_id = "1234-2345-abcd"

    # Mock sorenson response
    sorenson_response = MagicMock()
    sorenson_response.status_code = 200
    requests_delete_mock.return_value = sorenson_response

    returned_value = stop_encoding(job_id)
    # In case of some problems, we should get an exception
    assert returned_value is None
Ejemplo n.º 4
0
def test_stop_encoding(requests_delete_mock, app):
    """Test if stopping encoding works."""
    job_id = "1234-2345-abcd"

    # Mock sorenson response
    sorenson_response = MagicMock()
    sorenson_response.status_code = 200
    requests_delete_mock.return_value = sorenson_response

    returned_value = stop_encoding(job_id)
    # In case of some problems, we should get an exception
    assert returned_value is None
Ejemplo n.º 5
0
 def handler(signum, frame):
     # TODO handle better file deleting and ObjectVersion cleaning
     map(lambda _info: stop_encoding(info['job_id']), job_ids)