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)
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)