Skip to content

Commit 7b7f1e4

Browse files
committed
done /adim/api/active_docs/{id}.json
1 parent 20a44df commit 7b7f1e4

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

tests/integration/conftest.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,22 @@ def tenant_params():
427427
email="email@invalid.invalid",
428428
org_name="org")
429429

430+
431+
@pytest.fixture(scope='module')
432+
def active_docs_update_body():
433+
return """
434+
{"swagger":"2.0","info":{"version":"1.0.1","title":"Test"},"paths":{"/test":{"get":{"operationId":"Test",
435+
"parameters":[],"responses":{"400":{"description":"bad input parameters"}}}}},"definitions":{}}
436+
"""
437+
438+
439+
@pytest.fixture(scope='module')
440+
def active_docs_update_params(active_docs_update_body):
441+
suffix = get_suffix()
442+
name = f"updated-{suffix}"
443+
return dict(name=name, body=active_docs_update_body)
444+
445+
430446
@pytest.fixture(scope='module')
431447
def active_docs_body():
432448
return """
Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,23 @@
11
from tests.integration import asserts
2-
from .asserts import assert_resource, assert_resource_params
2+
3+
4+
def test_active_docs_can_be_created(active_doc, active_docs_params):
5+
asserts.assert_resource(active_doc)
6+
asserts.assert_resource_params(active_doc, active_docs_params)
7+
38

49
def test_active_docs_fetch(active_doc):
510
ac = active_doc.client.fetch(int(active_doc['id']))
611
assert ac
712
assert ac['id'] == active_doc['id']
13+
14+
15+
def test_active_docs_list(api, active_doc):
16+
active_docs = api.active_docs.list()
17+
assert len(active_docs) >= 1
18+
19+
20+
def test_active_docs_update(active_doc, active_docs_update_params):
21+
updated_active_doc = active_doc.update(params=active_docs_update_params)
22+
asserts.assert_resource(updated_active_doc)
23+
asserts.assert_resource_params(updated_active_doc, active_docs_update_params)

0 commit comments

Comments
 (0)