# 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/reader.py
# def read_file(input_filename, json_format=True):
# def read_content(payload_dictionary):
# 
# Path: adsft/tests/test_base.py
# def build_links(test_name):
#     def setUp(self):
#     def tearDown(self):
#     def setUp(self):
#     def tearDown(self):
#     def helper_get_details(self, test_publish):
#     def calculate_expected_folders(self, full_text_links):
#     def clean_up_path(self, paths):
# class TestUnit(unittest.TestCase):
# class TestGeneric(unittest.TestCase):
#         PROJ_HOME = self.app.conf['PROJ_HOME']


import unittest
import os
import sys
import json
from mock import patch
from adsft import tasks, reader
from adsft.tests import test_base
from datetime import datetime
from mock import patch
        from run import read_links_from_file
            )

            if os.path.exists(meta_path):
                with open(meta_path, 'r') as meta_file:
                    meta_content = meta_file.read()
                self.assertTrue(
                    'NOT_EXTRACTED_BEFORE' in meta_content,
                    'meta file does not contain the right extract keyword: {0}'
                    .format(meta_content)
                )

            fulltext_path = os.path.join(path, 'fulltext.txt.gz')
            self.assertTrue(
                os.path.exists(fulltext_path),
                'Full text file not created: %s'.format(path)
            )

            # unless changed, tests/test_integration/stub_data/full_test_elsevier.xml
            if os.path.exists(fulltext_path):
                fulltext_content = reader.read_file(fulltext_path, json_format=False)
                self.assertEqual(fulltext_content,
                                 '1 Introduction JOURNAL CONTENT Acknowledgments THANK YOU Appendix A APPENDIX TITLE APPENDIX')

            acknowledgments_path = os.path.join(path, 'acknowledgements.txt.gz')
            self.assertTrue(
                os.path.exists(acknowledgments_path),
                'Full text file not created: %s'.format(path)
            )

            if os.path.exists(acknowledgments_path):

# 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/reader.py
# def read_file(input_filename, json_format=True):
# def read_content(payload_dictionary):
# 
# Path: adsft/tests/test_base.py
# def build_links(test_name):
#     def setUp(self):
#     def tearDown(self):
#     def setUp(self):
#     def tearDown(self):
#     def helper_get_details(self, test_publish):
#     def calculate_expected_folders(self, full_text_links):
#     def clean_up_path(self, paths):
# class TestUnit(unittest.TestCase):
# class TestGeneric(unittest.TestCase):
#         PROJ_HOME = self.app.conf['PROJ_HOME']


# Path: adsft/tests/test_extra_acknowledgement_file_is_made.py
import unittest
import os
import sys
import json
from mock import patch
from adsft import tasks, reader
from adsft.tests import test_base
from datetime import datetime
from mock import patch
        from run import read_links_from_file

            )

            if os.path.exists(meta_path):
                with open(meta_path, 'r') as meta_file:
                    meta_content = meta_file.read()
                self.assertTrue(
                    'NOT_EXTRACTED_BEFORE' in meta_content,
                    'meta file does not contain the right extract keyword: {0}'
                    .format(meta_content)
                )

            fulltext_path = os.path.join(path, 'fulltext.txt.gz')
            self.assertTrue(
                os.path.exists(fulltext_path),
                'Full text file not created: %s'.format(path)
            )

            # unless changed, tests/test_integration/stub_data/full_test_elsevier.xml
            if os.path.exists(fulltext_path):
                fulltext_content = reader.read_file(fulltext_path, json_format=False)
                self.assertEqual(fulltext_content,
                                 '1 Introduction JOURNAL CONTENT Acknowledgments THANK YOU Appendix A APPENDIX TITLE APPENDIX')

            acknowledgments_path = os.path.join(path, 'acknowledgements.txt.gz')
            self.assertTrue(
                os.path.exists(acknowledgments_path),
                'Full text file not created: %s'.format(path)
            )

            if os.path.exists(acknowledgments_path):

                acknowledgements_content = reader.read_file(acknowledgments_path, json_format=False)