예제 #1
0
    def test__file_dir_and_symlink(self):
        st_mode = Factory.lstat(self.file)[0]
        self.assertEquals(Factory.guess_filetype(st_mode), G.TYPE_FILE)

        st_mode = Factory.lstat(self.dir)[0]
        self.assertEquals(Factory.guess_filetype(st_mode), G.TYPE_DIR)

        st_mode = Factory.lstat(self.symlink)[0]
        self.assertEquals(Factory.guess_filetype(st_mode), G.TYPE_SYMLINK)
예제 #2
0
    def test__other(self):
        _path = "/dev/null"
        if not os.path.exists(_path):
            logging.warn("%s does not exist. Skip this test." % _path)

        st_mode = Factory.lstat(_path)[0]
        self.assertEquals(Factory.guess_filetype(st_mode), G.TYPE_OTHER)