@@ -0,0 +1,1356 @@
+# -*- coding: utf-8 -*-%0A%0A# FOGLAMP_BEGIN%0A# See: http://foglamp.readthedocs.io/%0A# FOGLAMP_END%0A%0A%22%22%22 Test tasks/purge/__main__.py entry point%0A%0A%22%22%22%0A%0Aimport pytest%0Afrom unittest.mock import patch, MagicMock%0A%0Afrom foglamp.tasks import purge%0A%0Afrom foglamp.common import logger%0Afrom foglamp.common.storage_client.storage_client import StorageClient%0Afrom foglamp.tasks.purge.purge import Purge%0Afrom foglamp.common.process import FoglampProcess%0Afrom foglamp.common.audit_logger import AuditLogger%0A%0A__author__ = %22Vaibhav Singhal%22%0A__copyright__ = %22Copyright (c) 2017 OSIsoft, LLC%22%0A__license__ = %22Apache 2.0%22%0A__version__ = %22$%7BVERSION%7D%22%0A%0A%0A@pytest.fixture%0Aasync def _purge_instance():%0A    mockStorageClient = MagicMock(spec=StorageClient)%0A    mockAuditLogger = AuditLogger(mockStorageClient)%0A    with patch.object(FoglampProcess, %22__init__%22):%0A        with patch.object(logger, %22setup%22):%0A            with patch.object(mockAuditLogger, %22__init__%22, return_value=None):%0A                p = Purge()%0A    return p%0A%0A%0A@pytest.allure.feature(%22unit%22)%0A@pytest.allure.story(%22tasks%22, %22purge%22)%0Adef test_main(_purge_instance):%0A    with patch.object(purge, %22__name__%22, %22__main__%22):%0A        purge.purge_process = _purge_instance%0A        with patch.object(Purge, 'run', return_value=None):%0A            purge.purge_process.run()%0A            purge.purge_process.run.assert_called_once_with()%0A

Test for purge main entry point