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)
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)
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
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
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(unclean, clean): assert utils.clean_filename(unclean, minimal_change=True) == clean
def test_clean_filename(unclean, clean): assert utils.clean_filename(unclean) == clean