Skip to content

Commit

Permalink
docs: re-document TestAPI and TestShared
Browse files Browse the repository at this point in the history
I considered merging them, now that (without TestAPIProxy) TestAPI is
the only subclass of TestShared.  But reorganizing the alphabetized
helpers in TestShared versus the strictly-sequenced TestAPI methods can
wait.
  • Loading branch information
cfm committed Feb 2, 2024
1 parent aaba8ca commit b82720b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
9 changes: 6 additions & 3 deletions client/tests/sdk/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@

class TestAPI(TestShared):
"""
Note that TestShared contains most of the test code, which is shared between
API and API Proxy tests.
Tests here used to call helper methods (without the `test_` prefix) in
`TestShared`, because some were implemented differently in `TestAPIProxy`,
which was intended to be run on Qubes with `qrexec` available. This is now
the only test module and path, but the separation from `TestShared` is still
useful, since these test methods must be run in order while recording VCR.py
cassettes via `utils.VCRAPI`.
"""

@VCRAPI.use_cassette
Expand Down Expand Up @@ -168,7 +172,6 @@ def test_get_reply_from_source(self):
def test_get_all_replies(self):
super().get_all_replies()

# This test is materially different in the API & API Proxy versions.
@VCRAPI.use_cassette
def test_download_reply(self):
r = self.api.get_all_replies()[0]
Expand Down
6 changes: 3 additions & 3 deletions client/tests/sdk/test_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

class TestShared:
"""
Base class for test code that is shared by the API and API proxy tests.
Tests in this file should not be prefixed with test_; they are called
only from subclasses.
Base class for tests against the SDK. Methods in this file should not be
prefixed with `test_`; they are run only from subclasses that define their
own `test_` methods to be picked up by pytest.
"""

# ---------------- AUTH VALIDATION ----------------
Expand Down

0 comments on commit b82720b

Please sign in to comment.