Skip to content

Commit

Permalink
Added the test_archive_check() function to test the work in Issue #38
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffshurtliff committed Nov 2, 2022
1 parent a46c4a6 commit 435eb16
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Supporting Modules
Additions to the :doc:`supporting modules <supporting-modules>`.

* Added the :py:exc:`khoros.errors.exceptions.InvalidParameterError` exception class.
* Added the :py:func:`khoros.utils.tests.test_archives.test_archive_check` test function.

Changed
=======
Expand Down
20 changes: 19 additions & 1 deletion khoros/utils/tests/test_archives.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
:Synopsis: This module is used by pytest to verify that the ``archives`` module functions properly
:Created By: Jeff Shurtliff
:Last Modified: Jeff Shurtliff
:Modified Date: 30 Sep 2022
:Modified Date: 02 Nov 2022
"""

import os
Expand Down Expand Up @@ -68,3 +68,21 @@ def test_unarchive_content(monkeypatch):
response = khoros_object.archives.unarchive(message_url='https://community.example.com/t5/-/-/ta-p/12345')
assert response.get('status') == 'success'


def test_archive_check():
"""This function tests the ability to check whether a message is archived.
.. versionadded:: 5.2.0
"""
# Instantiate the core object
khoros_object = resources.get_core_object()

# Define message IDs to test
archived_content = '30127'
online_content = '58909'

# Perform and assess the methods
assert khoros_object.archives.is_archived(archived_content) is True
assert khoros_object.archives.is_archived(online_content) is False


0 comments on commit 435eb16

Please sign in to comment.