# Path: adsft/tasks.py
# def task_check_if_extract(message):
# def task_extract(message):
#     def task_extract_grobid(message):
# def task_output_results(msg):
# def task_identify_facilities(message):
# 
# Path: adsft/app.py
# class ADSFulltextCelery(ADSCelery):
# 
# Path: adsft/checker.py
# def file_last_modified_time(file_input):
# def create_meta_path(dict_input, extract_path):
# def meta_output_exists(file_input, extract_path):
# def load_meta_file(file_input, extract_path):
# def meta_needs_update(dict_input, meta_content,
#                       extract_path):
# def check_if_extract(message_list, extract_path):
#     NEEDS_UPDATE = ["MISSING_FULL_TEXT", "DIFFERING_FULL_TEXT", "STALE_CONTENT",
#                     "STALE_META", "NOT_EXTRACTED_BEFORE", "FORCE_TO_EXTRACT",
#                     "FORCE_TO_SEND"]


import sys
import os
import unittest
import time
import json
from builtins import range
from mock import MagicMock
from adsft import tasks, app
from adsft import checker


    def tearDown(self):
        unittest.TestCase.tearDown(self)
        self.app.close_app()
        tasks.app = self._app


class TestGeneric(unittest.TestCase):
    """
    Generic test class. Used as the primary class that implements a standard
    integration test. Also contains a range of helper functions, and the correct
    tearDown method when interacting with RabbitMQ.
    """

    def setUp(self):
        """
        Sets up the parameters for the RabbitMQ workers, and also the workers
        themselves. Generates all the queues that should be in place for testing
        the RabbitMQ workers.

        :return: no return
        """
        unittest.TestCase.setUp(self)
        self.proj_home = os.path.realpath(os.path.join(os.path.dirname(__file__), '../..'))
        self._app = tasks.app
        self.app = app.ADSFulltextCelery('test', proj_home=self.proj_home, local_config=\
            {
            'FULLTEXT_EXTRACT_PATH': os.path.join(self.proj_home, 'tests/test_unit/stub_data'),
            'CELERY_BROKER': tasks.app.conf['CELERY_BROKER'] + '_test'
            })

# Path: adsft/tasks.py
# def task_check_if_extract(message):
# def task_extract(message):
#     def task_extract_grobid(message):
# def task_output_results(msg):
# def task_identify_facilities(message):
# 
# Path: adsft/app.py
# class ADSFulltextCelery(ADSCelery):
# 
# Path: adsft/checker.py
# def file_last_modified_time(file_input):
# def create_meta_path(dict_input, extract_path):
# def meta_output_exists(file_input, extract_path):
# def load_meta_file(file_input, extract_path):
# def meta_needs_update(dict_input, meta_content,
#                       extract_path):
# def check_if_extract(message_list, extract_path):
#     NEEDS_UPDATE = ["MISSING_FULL_TEXT", "DIFFERING_FULL_TEXT", "STALE_CONTENT",
#                     "STALE_META", "NOT_EXTRACTED_BEFORE", "FORCE_TO_EXTRACT",
#                     "FORCE_TO_SEND"]


# Path: adsft/tests/test_base.py
import sys
import os
import unittest
import time
import json
from builtins import range
from mock import MagicMock
from adsft import tasks, app
from adsft import checker


    def tearDown(self):
        unittest.TestCase.tearDown(self)
        self.app.close_app()
        tasks.app = self._app


class TestGeneric(unittest.TestCase):
    """
    Generic test class. Used as the primary class that implements a standard
    integration test. Also contains a range of helper functions, and the correct
    tearDown method when interacting with RabbitMQ.
    """

    def setUp(self):
        """
        Sets up the parameters for the RabbitMQ workers, and also the workers
        themselves. Generates all the queues that should be in place for testing
        the RabbitMQ workers.

        :return: no return
        """
        unittest.TestCase.setUp(self)
        self.proj_home = os.path.realpath(os.path.join(os.path.dirname(__file__), '../..'))
        self._app = tasks.app
        self.app = app.ADSFulltextCelery('test', proj_home=self.proj_home, local_config=\
            {
            'FULLTEXT_EXTRACT_PATH': os.path.join(self.proj_home, 'tests/test_unit/stub_data'),
            'CELERY_BROKER': tasks.app.conf['CELERY_BROKER'] + '_test'
            })

        tasks.app = self.app # monkey-patch the app object
