Skip to content

Commit a853cde

Browse files
committed
Progress towards tested docs
1 parent 8d31375 commit a853cde

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

docs/source/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
extensions = [
1515
"sphinx.ext.autodoc",
16+
"sphinx.ext.doctest",
1617
"sphinx.ext.intersphinx",
1718
"sphinx.ext.napoleon",
1819
"sphinx_autodoc_typehints",

docs/source/index.rst

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Usage
1616

1717
See the :doc:`api-reference` for full usage details.
1818

19+
.. TODO - make this a doctest with hidden mock as setup
20+
1921
.. code:: python
2022
2123
import io
@@ -61,20 +63,24 @@ To write unit tests for code which uses this library, without using your Vuforia
6163

6264
pip3 install vws-python-mock
6365

64-
.. code:: python
66+
.. testcode::
67+
68+
import io
6569

66-
from mock_vws import MockVWS, VuforiaDatabase
70+
from mock_vws.database import VuforiaDatabase
71+
from mock_vws import MockVWS
72+
from vws import CloudRecoService, VWS
6773

6874
with MockVWS() as mock:
6975
database = VuforiaDatabase()
7076
mock.add_database(database=database)
7177
vws_client = VWS(
72-
server_access_key=server_access_key,
73-
server_secret_key=server_secret_key,
78+
server_access_key=database.server_access_key,
79+
server_secret_key=database.server_secret_key,
7480
)
7581
cloud_reco_client = CloudRecoService(
76-
client_access_key=client_access_key,
77-
client_secret_key=client_secret_key,
82+
client_access_key=database.client_access_key,
83+
client_secret_key=database.client_secret_key,
7884
)
7985

8086
name = 'my_image_name'

0 commit comments

Comments
 (0)