-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
done /adim/api/active_docs/{id}.json
- Loading branch information
1 parent
20a44df
commit f459786
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -427,6 +427,22 @@ def tenant_params(): | |
email="[email protected]", | ||
org_name="org") | ||
|
||
|
||
@pytest.fixture(scope='module') | ||
def active_docs_update_body(): | ||
return """ | ||
{"swagger":"2.0","info":{"version":"1.0.1","title":"Test"},"paths":{"/test":{"get":{"operationId":"Test", | ||
"parameters":[],"responses":{"400":{"description":"bad input parameters"}}}}},"definitions":{}} | ||
""" | ||
|
||
|
||
@pytest.fixture(scope='module') | ||
def active_docs_update_params(active_docs_update_body): | ||
suffix = get_suffix() | ||
name = f"updated-{suffix}" | ||
return dict(name=name, body=active_docs_update_body) | ||
|
||
|
||
@pytest.fixture(scope='module') | ||
def active_docs_body(): | ||
return """ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,29 @@ | ||
from unittest import skipIf | ||
|
||
import pytest | ||
|
||
from tests.integration import asserts | ||
from .asserts import assert_resource, assert_resource_params | ||
from .conftest import active_docs_params, get_suffix | ||
|
||
|
||
def test_active_docs_can_be_created(active_doc, active_docs_params): | ||
asserts.assert_resource(active_doc) | ||
asserts.assert_resource_params(active_doc, active_docs_params) | ||
|
||
|
||
def test_active_docs_fetch(active_doc): | ||
ac = active_doc.client.fetch(int(active_doc['id'])) | ||
assert ac | ||
assert ac['id'] == active_doc['id'] | ||
|
||
|
||
def test_active_docs_list(api, active_doc): | ||
active_docs = api.active_docs.list() | ||
assert len(active_docs) >= 1 | ||
|
||
|
||
def test_active_docs_update(active_doc, active_docs_update_params): | ||
updated_active_doc = active_doc.update(params=active_docs_update_params) | ||
asserts.assert_resource(updated_active_doc) | ||
asserts.assert_resource_params(updated_active_doc, active_docs_update_params) |