Skip to content

Commit 903e74a

Browse files
author
jozanini
committed
changed documentation to reflect better instructions for passing tests
1 parent 5e90be6 commit 903e74a

File tree

2 files changed

+32
-18
lines changed

2 files changed

+32
-18
lines changed

docs/contributing.rst

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ See the project's `Makefile` targets for a list of common developer tasks, which
2626
Notes on the Test Suite
2727
-----------------------
2828

29-
To test all the API endpoints, the account that you use for testing must be an *admin* and *compliance officer* user for your Webex Organization. Additionally, you should know that that the testing process creates some test people, rooms, messages, teams, and etc. as part of executing the test suite.
29+
To test all the API endpoints, the account that you use for testing must be an *admin* and *compliance officer* user for your Webex Organization. Additionally, you should know that that the testing process creates some test people, rooms, messages, teams, and etc. as part of executing the test suite.
3030

3131
We strongly recommend *NOT* running the test suite using your personal Webex account (not that you can't; it's just that you probably don't want it cluttering your account with all these test artifacts).
3232

@@ -42,32 +42,45 @@ Contributing Code
4242

4343
2. Fork a copy of the `repository`_ and clone your forked repository to your development environment.
4444

45-
3. Use the ``setup`` target to install the project dependencies and setup your environment for development.
45+
3. Create a Python virtual environment and install the project dependencies.
46+
47+
.. code-block:: bash
48+
49+
python -m venv .venv
50+
source .venv/bin/activate
51+
52+
4. Use the ``setup`` target to install the project dependencies and setup your environment for development.
4653

4754
.. code-block:: bash
4855
4956
make setup
5057
51-
4. Add your code to your forked repository.
58+
5. Install the SDK in Editable Mode.
59+
60+
.. code-block:: bash
61+
62+
pip install -e
63+
64+
5. Add your code to your forked repository.
5265

5366
If you are creating some new feature or functionality (excellent!), please also write tests to verify that your code works as expected.
5467

55-
5. Please format your code and make sure your code passes the linter.
68+
6. Please format your code and make sure your code passes the linter.
5669

5770
.. code-block:: bash
5871
5972
make format
6073
make lint
6174
62-
6. If you running the test suite locally, ensure your code passes all of the default tests. Use the ``test`` target and ensure all tests execute successfully.
75+
7. If you running the test suite locally, ensure your code passes all of the default tests. Use the ``test`` target and ensure all tests execute successfully.
6376

6477
.. code-block:: bash
6578
66-
make test
79+
make tests
6780
68-
7. Commit your changes.
81+
8. Commit your changes.
6982

70-
8. Submit a `pull request`_.
83+
9. Submit a `pull request`_.
7184

7285

7386
Running the Test Suite Locally
@@ -78,6 +91,7 @@ To run the test suite locally, you must configure the following environment vari
7891
* ``WEBEX_ACCESS_TOKEN`` - Your test account's Webex access token.
7992

8093
* ``WEBEX_TEST_DOMAIN`` - The test suite creates some users as part of the testing process. The test suite uses this domain name as the e-mail suffix of for the user's e-mail addresses.
94+
To ensure that the developer passes all tests, the developer should use the domain name of the sandbox organization that they have created.
8195

8296
* ``WEBEX_TEST_ID_START`` - The test suite uses this integer as the starting number for creating test user accounts (example: "[email protected]").
8397

tests/api/test_people.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ def update_person(api, person, **person_attributes):
5151
return api.people.update(person.id, **new_attributes)
5252

5353

54+
def delete_person(api, person):
55+
"""Delete a person and swallow any API Error."""
56+
try:
57+
api.people.delete(person.id)
58+
except webexpythonsdk.ApiError:
59+
pass
60+
61+
5462
def is_valid_person(obj):
5563
return isinstance(obj, webexpythonsdk.Person) and obj.id is not None
5664

@@ -118,16 +126,8 @@ def __iter__(self):
118126
return iter(self.list)
119127

120128
def __del__(self):
121-
# TODO: Enable test account clean-up.
122-
# Licensed privileges aren't taking effect for accounts that have
123-
# just been created and this is causing some tests to fail.
124-
# I am temporarily disabling test account clean-up to enable the
125-
# accounts (with their privileges) to persist. It would be good to
126-
# find a way around this.
127-
128-
# for person in self.test_people.values():
129-
# delete_person(self._api, person)
130-
pass
129+
for person in self.test_people.values():
130+
delete_person(self._api, person)
131131

132132

133133
@pytest.fixture(scope="session")

0 commit comments

Comments
 (0)