Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Commit

Permalink
Move all unitests including live_server as integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xlz-jbleclere committed Aug 24, 2020
1 parent dac1a42 commit b51995f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
6 changes: 0 additions & 6 deletions tests/test_async_health.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ def test_health_period_disabled(accelize_drm, conf_json, cred_json, async_handle
remove(logpath)


#@pytest.mark.skip(reason='Bug in async feature')
@pytest.mark.no_parallel
@pytest.mark.minimum
def test_health_period_modification(accelize_drm, conf_json, cred_json, async_handler, live_server):
Expand Down Expand Up @@ -128,7 +127,6 @@ def test_health_period_modification(accelize_drm, conf_json, cred_json, async_ha
assert get_proxy_error() is None


#@pytest.mark.skip(reason='Bug in async feature')
@pytest.mark.no_parallel
@pytest.mark.minimum
def test_health_retry_disabled(accelize_drm, conf_json, cred_json, async_handler, live_server):
Expand Down Expand Up @@ -183,7 +181,6 @@ def test_health_retry_disabled(accelize_drm, conf_json, cred_json, async_handler
assert get_proxy_error() is None


#@pytest.mark.skip(reason='Bug in async feature')
@pytest.mark.no_parallel
@pytest.mark.minimum
def test_health_retry_modification(accelize_drm, conf_json, cred_json, async_handler, live_server):
Expand Down Expand Up @@ -247,7 +244,6 @@ def test_health_retry_modification(accelize_drm, conf_json, cred_json, async_han
assert get_proxy_error() is None


#@pytest.mark.skip(reason='Bug in async feature')
@pytest.mark.no_parallel
@pytest.mark.minimum
def test_health_retry_sleep_modification(accelize_drm, conf_json, cred_json, async_handler, live_server):
Expand Down Expand Up @@ -312,7 +308,6 @@ def test_health_retry_sleep_modification(accelize_drm, conf_json, cred_json, asy
assert get_proxy_error() is None


#@pytest.mark.skip(reason='Bug in async feature')
@pytest.mark.no_parallel
@pytest.mark.minimum
def test_health_metering_data(accelize_drm, conf_json, cred_json, async_handler, live_server, ws_admin):
Expand Down Expand Up @@ -381,7 +376,6 @@ def wait_and_check_on_next_health(drm):
async_cb.assert_NoError()


#@pytest.mark.skip(reason='Bug in async feature')
@pytest.mark.no_parallel
def test_segment_index(accelize_drm, conf_json, cred_json, async_handler, live_server):
"""
Expand Down
2 changes: 2 additions & 0 deletions tests/test_authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from tests.proxy import get_context, set_context


@pytest.mark.no_parallel
def test_authentication_bad_token(accelize_drm, conf_json, cred_json, async_handler, live_server):
"""Test when a bad authentication token is used"""

Expand Down Expand Up @@ -109,6 +110,7 @@ def test_authentication_validity_after_deactivation(accelize_drm, conf_json, cre
drm_manager.deactivate()


@pytest.mark.no_parallel
@pytest.mark.hwtst
def test_authentication_token_renewal(accelize_drm, conf_json, cred_json, async_handler, live_server):
"""Test a different authentication token is given after expiration"""
Expand Down
1 change: 1 addition & 0 deletions tests/test_lgdn_topics.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from tests.proxy import get_context, set_context


@pytest.mark.no_parallel
@pytest.mark.lgdn
def test_topic0_corrupted_segment_index(accelize_drm, conf_json, cred_json, async_handler, live_server):
"""
Expand Down
6 changes: 5 additions & 1 deletion tests/test_retry_mechanism.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from tests.proxy import get_context, set_context


@pytest.mark.no_parallel
def test_api_retry_disabled(accelize_drm, conf_json, cred_json, async_handler, live_server):
"""
Test retry mechanism is disabled on API function (not including the retry in background thread)
Expand Down Expand Up @@ -53,6 +54,7 @@ def test_api_retry_disabled(accelize_drm, conf_json, cred_json, async_handler, l
async_cb.assert_NoError()


@pytest.mark.no_parallel
def test_api_retry_enabled(accelize_drm, conf_json, cred_json, async_handler, live_server):
"""
Test retry mechanism is working on API function (not including the retry in background thread)
Expand Down Expand Up @@ -87,13 +89,14 @@ def test_api_retry_enabled(accelize_drm, conf_json, cred_json, async_handler, li
with open(logpath, 'rt') as f:
log_content = f.read()
assert 'Metering Web Service error 408' in log_content
assert 'DRM WS request failed' inlog_content
assert 'DRM WS request failed' in log_content
m = search(r'Timeout on License request after (\d+) attempts', log_content)
assert m is not None
assert int(m.group(1)) > 1
async_cb.assert_NoError()


@pytest.mark.no_parallel
def test_long_to_short_retry_switch(accelize_drm, conf_json, cred_json, async_handler, live_server):
"""
Test the number of expected retris and the gap between 2 retries are correct when a retryable error is returned
Expand Down Expand Up @@ -155,6 +158,7 @@ def test_long_to_short_retry_switch(accelize_drm, conf_json, cred_json, async_ha
assert (retryShortPeriod-1) <= lic_delta <= (retryShortPeriod+1)


@pytest.mark.no_parallel
def test_retry_on_no_connection(accelize_drm, conf_json, cred_json, async_handler, live_server):
"""
Test the number of expected retris and the gap between 2 retries are correct when the requests are lost
Expand Down

0 comments on commit b51995f

Please sign in to comment.