Пример #1
0
    def test_invalid_chars(self):
        '''It should replace invalid chars'''

        self.assertEqual(safe_filename('\x00abc', 'Linux'), '_abc')
        self.assertEqual(safe_filename('\x00abc', 'Windows'), '_abc')
        self.assertEqual(safe_filename('"abc:"', 'Windows'), '_abc__')
Пример #2
0
    def test_seperators(self):
        '''It should replace path separators'''

        self.assertEqual(safe_filename('a/b', 'Linux'), 'a_b')
        self.assertEqual(safe_filename('a/b', 'Windows'), 'a_b')
        self.assertEqual(safe_filename('a\\b', 'Windows'), 'a_b')