コード例 #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)
コード例 #2
0
ファイル: test_utils.py プロジェクト: SivaPandeti/coursera
 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)
コード例 #3
0
ファイル: test_utils.py プロジェクト: SivaPandeti/coursera
 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)
コード例 #4
0
ファイル: test_utils.py プロジェクト: chiung/coursera
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
コード例 #5
0
ファイル: test_utils.py プロジェクト: chiung/coursera
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
コード例 #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)
コード例 #7
0
ファイル: test_utils.py プロジェクト: vladistan/coursera
 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)
コード例 #8
0
ファイル: test_utils.py プロジェクト: ComedianBlacki/coursera
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
コード例 #9
0
ファイル: test_utils.py プロジェクト: amanrai00/coursera
def test_clean_filename_minimal_change(unclean, clean):
    assert utils.clean_filename(unclean, minimal_change=True) == clean
コード例 #10
0
ファイル: test_utils.py プロジェクト: amanrai00/coursera
def test_clean_filename(unclean, clean):
    assert utils.clean_filename(unclean) == clean
コード例 #11
0
ファイル: test_utils.py プロジェクト: daodaowei/coursera-dl
def test_clean_filename_minimal_change(unclean, clean):
    assert utils.clean_filename(unclean, minimal_change=True) == clean
コード例 #12
0
ファイル: test_utils.py プロジェクト: daodaowei/coursera-dl
def test_clean_filename(unclean, clean):
    assert utils.clean_filename(unclean) == clean