'Test sanitize filename'

def test_sanitize_filename(self):

    test_cases = {None: u'', 42: u'', '': u'', 'filename': u'filename', 'fi\\le/na*me': u'fi-le-na-me', 'fi:le"na<me': u'filename', 'fi>le|na?me': u'filename', '    .    file\\u2122name.    .': u'filename'}
    unicode_test_cases = {u'': u'', u'filename': u'filename', u'fi\\le/na*me': u'fi-le-na-me', u'fi:le"na<me': u'filename', u'fi>le|na?me': u'filename', u'    .    file\u2122name.    .': u'filename'}
    for tests in (test_cases, unicode_test_cases):
        for (filename, result) in six.iteritems(tests):
            self.assertEqual(sanitize_filename(filename), result)
