# Path: adsft/utils.py
# class FileInputStream(object):
# class TextCleaner(object):
#     def __init__(self, input_stream):
#     def print_info(self):
#     def extract(self, force_extract=False, force_send=False):
#     def __init__(self, text):
#     def translate(self):
#     def decode(self):
#     def normalise(self):
#     def trimwords(self, maxlength=100):
#     def run(self, translate=True, decode=True, normalise=True, trim=True):
# def get_filenames(file_string):
# 
# 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
# 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 sys
import unittest
import os
import re
    from builtins import str
from adsft import utils, checker
from adsft.tests import test_base
            meta_content,
            self.app.conf['FULLTEXT_EXTRACT_PATH']
        )

        self.assertEqual(updated,
                         'DIFFERING_FULL_TEXT',
                         'The ft_source should need updating, not {0}'
                         .format(updated)
        )


    def test_file_should_be_updated_if_content_is_stale(self):
        """
        Tests the meta_needs_update function. Loads meta data from the disk, and
        finds the full text path. Opens the full text file and writes some fresh
        content so that it is more new than the meta data file. This will result
        in the meta_needs_update supplying the STALE_CONTENT flag.

        :return: no return
        """

        FileInputStream = utils.FileInputStream(self.test_file_exists)
        FileInputStream.extract()

        # Ensure the PDF more new than the meta.json
        payload = FileInputStream.payload[0]
        with open(payload['ft_source'], 'w') as not_stale:
            not_stale.write('PDF')

        # Not a nicer way to do this without cleaning up some tests

# Path: adsft/utils.py
# class FileInputStream(object):
# class TextCleaner(object):
#     def __init__(self, input_stream):
#     def print_info(self):
#     def extract(self, force_extract=False, force_send=False):
#     def __init__(self, text):
#     def translate(self):
#     def decode(self):
#     def normalise(self):
#     def trimwords(self, maxlength=100):
#     def run(self, translate=True, decode=True, normalise=True, trim=True):
# def get_filenames(file_string):
# 
# 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
# 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_checker.py
import sys
import unittest
import os
import re
    from builtins import str
from adsft import utils, checker
from adsft.tests import test_base

            meta_content,
            self.app.conf['FULLTEXT_EXTRACT_PATH']
        )

        self.assertEqual(updated,
                         'DIFFERING_FULL_TEXT',
                         'The ft_source should need updating, not {0}'
                         .format(updated)
        )


    def test_file_should_be_updated_if_content_is_stale(self):
        """
        Tests the meta_needs_update function. Loads meta data from the disk, and
        finds the full text path. Opens the full text file and writes some fresh
        content so that it is more new than the meta data file. This will result
        in the meta_needs_update supplying the STALE_CONTENT flag.

        :return: no return
        """

        FileInputStream = utils.FileInputStream(self.test_file_exists)
        FileInputStream.extract()

        # Ensure the PDF more new than the meta.json
        payload = FileInputStream.payload[0]
        with open(payload['ft_source'], 'w') as not_stale:
            not_stale.write('PDF')

        # Not a nicer way to do this without cleaning up some tests

        meta_content = checker.load_meta_file(