def test_folder_unix(self): fi = UnixFileIcons() fname = "../test/samplefiles" index = fi.getFileImage(fname) self.assertEqual(fi.dictSize, 0) self.assertEqual(fi.imageListCount, 2) self.assertEqual(index, 1)
def test_invalid_icon_unix(self): fi = UnixFileIcons() fname = "c:\\file.abyrvalg" index = fi.getFileImage(fname) self.assertEqual(fi.dictSize, 0) self.assertEqual(fi.imageListCount, 2) self.assertEqual(index, 0)
def test_clear_after_invalid_unix(self): fi = UnixFileIcons() fi.clear() index = fi.getFileImage("c:\\file.abyrvalg") self.assertEqual(fi.dictSize, 0) self.assertEqual(fi.imageListCount, 2) self.assertEqual(index, 0)
def test_clear_after_unix(self): fi = UnixFileIcons() fi.clear() index = fi.getFileImage("c:\\file.bmp") self.assertEqual(fi.dictSize, 1) self.assertEqual(fi.imageListCount, 3) self.assertEqual(index, 2)
def test_clear_after_folder_unix(self): fi = UnixFileIcons() fi.clear() index = fi.getFileImage("../test/samplefiles") self.assertEqual(fi.dictSize, 0) self.assertEqual(fi.imageListCount, 2) self.assertEqual(index, 1)
def testExt_unix(self): fi = UnixFileIcons() index = fi.getFileImage("/file.bmp") self.assertEqual(fi.dictSize, 1) self.assertEqual(fi.imageListCount, 3) self.assertEqual(index, 2) index = fi.getFileImage("/file.gif") self.assertEqual(fi.dictSize, 2) self.assertEqual(fi.imageListCount, 4) self.assertEqual(index, 3) index = fi.getFileImage("/other_file.bmp") self.assertEqual(fi.dictSize, 2) self.assertEqual(fi.imageListCount, 4) self.assertEqual(index, 2)
def testInit_unix(self): fi = UnixFileIcons() self.assertEqual(fi.dictSize, 0) self.assertEqual(fi.imageListCount, 0)
def fileIcons(self): return UnixFileIcons()