Exemple #1
0
 def test_clean_filename(self):
     strings = {
         '(23:90)': '23-90',
         '(:': '-',
         'a téest &and a@noòtheèr': 'a_test_and_another',
         'Lecture 2.7 - Evaluation and Operators (16:25)':
         'Lecture_2.7_-_Evaluation_and_Operators_16-25',
         'Week 3: Data and Abstraction': 'Week_3-_Data_and_Abstraction'
     }
     for k, v in six.iteritems(strings):
         self.assertEquals(utils.clean_filename(k), v)
Exemple #2
0
 def test_clean_filename(self):
     strings = {
         '(23:90)': '23-90',
         '(:': '-',
         'a téest &and a@noòtheèr': 'a_test_and_another',
         'Lecture 2.7 - Evaluation and Operators (16:25)':
         'Lecture_2.7_-_Evaluation_and_Operators_16-25',
         'Week 3: Data and Abstraction':
         'Week_3-_Data_and_Abstraction'
     }
     for k, v in six.iteritems(strings):
         self.assertEquals(utils.clean_filename(k), v)
Exemple #3
0
 def test_clean_filename_minimal_change(self):
     strings = {
         '(23:90)': '(23-90)',
         '(:': '(-',
         'a téest &and a@noòtheèr': 'a téest &and a@noòtheèr',
         'Lecture 2.7 - Evaluation and Operators (16:25)':
         'Lecture 2.7 - Evaluation and Operators (16-25)',
         'Week 3: Data and Abstraction':
         'Week 3- Data and Abstraction',
         '  (Week 1) BRANDING:  Marketing Strategy and Brand Positioning':
         '  (Week 1) BRANDING-  Marketing Strategy and Brand Positioning'
     }
     for k, v in six.iteritems(strings):
         self.assertEquals(utils.clean_filename(k, minimal_change=True), v)
Exemple #4
0
def test_clean_filename_minimal_change():
    strings = {
        '(23:90)': '(23-90)',
        '(:': '(-',
        'a téest &and a@noòtheèr': 'a téest &and a@noòtheèr',
        'Lecture 2.7 - Evaluation and Operators (16:25)':
        'Lecture 2.7 - Evaluation and Operators (16-25)',
        'Week 3: Data and Abstraction': 'Week 3- Data and Abstraction',
        '  (Week 1) BRANDING:  Marketing Strategy and Brand Positioning':
        '  (Week 1) BRANDING-  Marketing Strategy and Brand Positioning',
        'test & " adfas': 'test & " adfas',
        ' ': u'\xa0'
    }
    for k, v in six.iteritems(strings):
        actual_res = utils.clean_filename(k, minimal_change=True)
        assert actual_res == v
Exemple #5
0
def test_clean_filename():
    strings = {
        '(23:90)': '23-90',
        '(:': '-',
        'a téest &and a@noòtheèr': 'a_test_and_another',
        'Lecture 2.7 - Evaluation and Operators (16:25)':
        'Lecture_2.7_-_Evaluation_and_Operators_16-25',
        'Week 3: Data and Abstraction': 'Week_3-_Data_and_Abstraction',
        '  (Week 1) BRANDING:  Marketing Strategy and Brand Positioning':
        'Week_1_BRANDING-__Marketing_Strategy_and_Brand_Positioning',
        'test & " adfas': 'test___adfas',
        ' ': ''
    }
    for k, v in six.iteritems(strings):
        actual_res = utils.clean_filename(k)
        assert actual_res == v
Exemple #6
0
 def test_clean_filename_minimal_change(self):
     strings = {
         '(23:90)':
         '(23-90)',
         '(:':
         '(-',
         'a téest &and a@noòtheèr':
         'a téest &and a@noòtheèr',
         'Lecture 2.7 - Evaluation and Operators (16:25)':
         'Lecture 2.7 - Evaluation and Operators (16-25)',
         'Week 3: Data and Abstraction':
         'Week 3- Data and Abstraction',
         '  (Week 1) BRANDING:  Marketing Strategy and Brand Positioning':
         '  (Week 1) BRANDING-  Marketing Strategy and Brand Positioning'
     }
     for k, v in six.iteritems(strings):
         self.assertEquals(utils.clean_filename(k, minimal_change=True), v)
Exemple #7
0
 def test_clean_filename(self):
     strings = {
         '(23:90)': '23-90',
         '(:': '-',
         'a téest &and a@noòtheèr': 'a_test_and_another',
         'Lecture 2.7 - Evaluation and Operators (16:25)':
         'Lecture_2.7_-_Evaluation_and_Operators_16-25',
         'Week 3: Data and Abstraction':
         'Week_3-_Data_and_Abstraction',
         '  (Week 1) BRANDING:  Marketing Strategy and Brand Positioning':
         'Week_1_BRANDING-__Marketing_Strategy_and_Brand_Positioning',
         'test & " adfas': 'test___adfas',
         ' ': ''
     }
     for k, v in six.iteritems(strings):
         actual_res = utils.clean_filename(k)
         self.assertEquals(actual_res, v, actual_res)
def test_clean_filename_minimal_change():
    strings = {
        '(23:90)': '(23-90)',
        '(:': '(-',
        'a téest &and a@noòtheèr': 'a téest &and a@noòtheèr',
        'Lecture 2.7 - Evaluation and Operators (16:25)':
        'Lecture 2.7 - Evaluation and Operators (16-25)',
        'Week 3: Data and Abstraction':
        'Week 3- Data and Abstraction',
        '  (Week 1) BRANDING:  Marketing Strategy and Brand Positioning':
        '  (Week 1) BRANDING-  Marketing Strategy and Brand Positioning',
        'test & " adfas': 'test & " adfas',
        ' ': u'\xa0'
    }
    for k, v in six.iteritems(strings):
        actual_res = utils.clean_filename(k, minimal_change=True)
        assert actual_res == v
Exemple #9
0
def test_clean_filename_minimal_change(unclean, clean):
    assert utils.clean_filename(unclean, minimal_change=True) == clean
Exemple #10
0
def test_clean_filename(unclean, clean):
    assert utils.clean_filename(unclean) == clean
Exemple #11
0
def test_clean_filename_minimal_change(unclean, clean):
    assert utils.clean_filename(unclean, minimal_change=True) == clean
Exemple #12
0
def test_clean_filename(unclean, clean):
    assert utils.clean_filename(unclean) == clean