Exemple #1
0
def test_get_file_ext():
    s = '\n'
    s += 'abc         = ' + util.get_file_ext('abc') + '\n'
    s += 'abc.ext     = ' + util.get_file_ext('abc.ext') + '\n'
    s += 'abc.def.ext = ' + util.get_file_ext('abc.def.ext') + '\n'
    s += 'aaa/abc     = ' + util.get_file_ext('aaa/abc') + '\n'
    s += 'aaa/abc/    = ' + util.get_file_ext('aaa/abc/') + '\n'
    s += 'aaa/abc.ext = ' + util.get_file_ext('aaa/abc.ext') + '\n'
    s += 'aaa\\abc     = ' + util.get_file_ext('aaa\\abc') + '\n'
    s += 'aaa\\abc.ext = ' + util.get_file_ext('aaa\\abc.ext') + '\n'
    s += 'aaa\\abc.def\\xyz.ext = ' + util.get_file_ext(
        'aaa\\abc.def\\xyz.ext') + '\n'
    return s
Exemple #2
0
    def ext(self):
        if self.is_dir:
            raise Exception("The path is a directory: " + self.path)

        return get_file_ext(self.path)