Esempio n. 1
0
	def test_03_delete_non_existing_file(self):
		''' test if requesting for delete of non existing thumbnail does not crash the tumbler'''

		uri = "file:///home/" + user() + "/MyDocs/.image/DSC_001.jpeg"
		thumbs = getThumbnailFilepaths(uri)
		deleteFiles(thumbs)
		self.assertEqual(areFilesDeleted(thumbs), True, 'Thumbnail could not be deleted for test.')

		# call tumbler delete cache function
		tumbler = Tumbler()
		tumbler.Cache_delete( [uri] )

		wait(200.0)

		self.assertEqual(isTumblerRunning(), True, 'Tumbler crashed after request of move of non existing thumbnail.')
Esempio n. 2
0
	def test_05_delete_wrong_uri(self):
		''' test if requesting for delete of not properly formated URI does not end up with Tumbler crash '''
		startTumblerProcess();
		self.assertEqual(isTumblerRunning(), True, 'Tumbler could not be started!')

		# no schema, no path, empty string, only space, trash
		uri = ["/home/" + user() + "/MyDocs/.image/DSC_001.jpeg", "DSC_001.jpeg", "", " ", "#!@$:;<>?/.,"]
		thumbs = getThumbnailFilepaths(uri[0])
		deleteFiles(thumbs)
		self.assertEqual(areFilesDeleted(thumbs), True, 'Thumbnails could not be deleted for test.')

		# call tumbler delete cache function
		tumbler = Tumbler()
		tumbler.Cache_delete( uri )
		wait(200.0)

		self.assertEqual(isTumblerRunning(), True, 'Tumbler crashed after request of move of non existing thumbnail.')
Esempio n. 3
0
	def test_04_delete_file_when_tumbler_is_not_running(self):
		''' test if thumbnails are deleted together with file - when tumbler is not running yet '''
		# create a thumbnails (every flavor will get one thumbnail)
		uri = "file:///home/" + user() + "/MyDocs/.image/DSC_001.jpeg"
		thumbs = createFakeThumbnail(uri)
		# check if all flavors exist
		self.assertEqual(areFilesExist(thumbs), True, 'not all flavors of thumbnail were created!')
		# kill Tumbler
		killTumblerProcess()
		self.assertEqual(isTumblerRunning(), False, 'Could not kill the Tumbler daemon.')

		# call tumbler delete cache function
		tumbler = Tumbler()
		tumbler.Cache_delete( [uri] )

		wait(800)

		# check if thumbnail (all flavors) was deleted also
		self.assertEqual(areFilesDeleted(thumbs), True, 'not all flavors of thumbnail were deleted!')
Esempio n. 4
0
	def test_02_delete_multiple_files(self):
		''' test if thumbnails are deleted together with deletiion of more than one file '''
		# create a thumbnails (every flavor will get one thumbnail)
		uris = ["file:///home/" + user() + "/MyDocs/.image/DSC_001.jpeg", "file:///home/" + user() + "/MyDocs/.image/DSC_002.jpeg", "file:///home/" + user() + "/MyDocs/.image/DSC_003.jpeg"]
		thumbs = createFakeThumbnails(uris)
		# check if all flavors exist
		self.assertEqual(areFilesExist(thumbs), True, 'not all flavors of thumbnail were created!')

		# call tumbler delete cache function
		tumbler = Tumbler()
		tumbler.Cache_delete( uris )

		delay = 0
		while(not areFilesDeleted(thumbs) and delay < 4000):
			wait(200)
			delay += 200

		# check if thumbnails (all flavors) were deleted also
		self.assertEqual(areFilesDeleted(thumbs), True, 'not all flavors of thumbnail were deleted!')
Esempio n. 5
0
	def test_01_delete_single_file(self):
		''' test if thumbnails are deleted together with file '''
		# create a thumbnails (every flavor will get one thumbnail)
		uri = "file:///home/" + user() + "/MyDocs/.image/DSC_001.jpeg"
		thumbs = createFakeThumbnail(uri)
		# check if all flavors exist
		self.assertEqual(areFilesExist(thumbs), True, 'not all flavors of thumbnail were created!')

		# call tumbler delete cache function
		tumbler = Tumbler()
		tumbler.Cache_delete( [uri] )

		delay = 0
		while(not areFilesDeleted(thumbs) and delay < 4000):
			wait(200)
			delay += 200

		# check if thumbnail (all flavors) was deleted also
		self.assertEqual(areFilesDeleted(thumbs), True, 'not all flavors of thumbnail were deleted!')