Skip to content

Commit

Permalink
done /adim/api/active_docs/{id}.json
Browse files Browse the repository at this point in the history
  • Loading branch information
Gituser010 committed Oct 15, 2024
1 parent 20a44df commit f459786
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 """
Expand Down
22 changes: 22 additions & 0 deletions tests/integration/test_integration_activedocs.py
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)

0 comments on commit f459786

Please sign in to comment.