mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 14:57:39 -02:30
remove forgotten print
This commit is contained in:
@@ -79,9 +79,6 @@ def test_basic_options_fields(hosts, fact_scans, options, user):
|
|||||||
url = reverse('api:host_fact_versions_list', args=(hosts[0].pk,))
|
url = reverse('api:host_fact_versions_list', args=(hosts[0].pk,))
|
||||||
response = options(url, None, user('admin', True), pk=hosts[0].id)
|
response = options(url, None, user('admin', True), pk=hosts[0].id)
|
||||||
|
|
||||||
import json
|
|
||||||
print(json.dumps(response.data))
|
|
||||||
|
|
||||||
assert 'related' in response.data['actions']['GET']
|
assert 'related' in response.data['actions']['GET']
|
||||||
assert 'module' in response.data['actions']['GET']
|
assert 'module' in response.data['actions']['GET']
|
||||||
assert ("ansible", "Ansible") in response.data['actions']['GET']['module']['choices']
|
assert ("ansible", "Ansible") in response.data['actions']['GET']['module']['choices']
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
# Python
|
# Python
|
||||||
import pytest
|
import pytest
|
||||||
|
import mock
|
||||||
from dateutil.relativedelta import relativedelta
|
from dateutil.relativedelta import relativedelta
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
|
||||||
@@ -91,7 +92,7 @@ def test_cleanup_logic(fact_scans, hosts):
|
|||||||
timestamp_pivot -= granularity
|
timestamp_pivot -= granularity
|
||||||
assert fact.timestamp == timestamp_pivot
|
assert fact.timestamp == timestamp_pivot
|
||||||
|
|
||||||
@mock.patch('awx.api.views.feature_enabled', new=mock_feature_enabled)
|
@mock.patch('awx.main.management.commands.cleanup_facts.feature_enabled', new=mock_feature_enabled)
|
||||||
@pytest.mark.django_db
|
@pytest.mark.django_db
|
||||||
def test_parameters_ok(mocker):
|
def test_parameters_ok(mocker):
|
||||||
run = mocker.patch('awx.main.management.commands.cleanup_facts.CleanupFacts.run')
|
run = mocker.patch('awx.main.management.commands.cleanup_facts.CleanupFacts.run')
|
||||||
@@ -162,7 +163,7 @@ def test_string_time_to_timestamp_invalid():
|
|||||||
res = cmd.string_time_to_timestamp(kv['time'])
|
res = cmd.string_time_to_timestamp(kv['time'])
|
||||||
assert res is None
|
assert res is None
|
||||||
|
|
||||||
@mock.patch('awx.api.views.feature_enabled', new=mock_feature_enabled)
|
@mock.patch('awx.main.management.commands.cleanup_facts.feature_enabled', new=mock_feature_enabled)
|
||||||
@pytest.mark.django_db
|
@pytest.mark.django_db
|
||||||
def test_parameters_fail(mocker):
|
def test_parameters_fail(mocker):
|
||||||
# Mock run() just in case, but it should never get called because an error should be thrown
|
# Mock run() just in case, but it should never get called because an error should be thrown
|
||||||
|
|||||||
Reference in New Issue
Block a user