# 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/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
import math
from builtins import chr
from adsft import utils
from adsft.tests import test_base
        self.assertIn('MNRAS', FileInputStream.provider)

    
    def test_trim(self):
        """
        Tests that the trim normalizes the text.
        """
        # non-breakable space
        if sys.version_info > (3,):
            a = b'a\xc2\xa0b'.decode('utf8')
            b = b'a' + b'\xc2\xa0' + b'b'  # utf-8 bytecode
        else:
            a = 'a\xc2\xa0b'.decode('utf8')
            b = 'a' + b'\xc2\xa0' + 'b' #utf-8 bytecode
        c = u'a' + u'\xa0' + u'b' # unicode
        d = u'a' + chr(160) + u'b'
        # string with a large token representing table data
        e = u'a ' + ('123%5.7890' * 100) + u' b' 
        for x in (a, b, c, d, e):
            r = utils.TextCleaner(x).run(translate=False, decode=True, normalise=True, trim=True)
            self.assertEqual(r, u'a b')

    def test_get_filenames(self):
        """test code that breaks up file name strings"""

        file_string = '/proj/ads/foo'
        files = utils.get_filenames(file_string)
        self.assertEqual([file_string], files)

        file_string = '/proj/ads/foo,/proj/ads/bar'

# 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/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_util.py
import sys
import unittest
import os
import re
import math
from builtins import chr
from adsft import utils
from adsft.tests import test_base

        self.assertIn('MNRAS', FileInputStream.provider)

    
    def test_trim(self):
        """
        Tests that the trim normalizes the text.
        """
        # non-breakable space
        if sys.version_info > (3,):
            a = b'a\xc2\xa0b'.decode('utf8')
            b = b'a' + b'\xc2\xa0' + b'b'  # utf-8 bytecode
        else:
            a = 'a\xc2\xa0b'.decode('utf8')
            b = 'a' + b'\xc2\xa0' + 'b' #utf-8 bytecode
        c = u'a' + u'\xa0' + u'b' # unicode
        d = u'a' + chr(160) + u'b'
        # string with a large token representing table data
        e = u'a ' + ('123%5.7890' * 100) + u' b' 
        for x in (a, b, c, d, e):
            r = utils.TextCleaner(x).run(translate=False, decode=True, normalise=True, trim=True)
            self.assertEqual(r, u'a b')

    def test_get_filenames(self):
        """test code that breaks up file name strings"""

        file_string = '/proj/ads/foo'
        files = utils.get_filenames(file_string)
        self.assertEqual([file_string], files)

        file_string = '/proj/ads/foo,/proj/ads/bar'

        files = utils.get_filenames(file_string)