def test_get_new_filename(self): new_path = legofy.get_new_filename(FLOWER_PATH) self.assertTrue(os.path.dirname(FLOWER_PATH) == os.path.dirname(new_path)) self.assertFalse(os.path.exists(new_path), "Should not find image : {0}".format(new_path)) self.assertTrue(new_path.endswith('_lego.jpg')) new_path = legofy.get_new_filename(FLOWER_PATH, '.gif') self.assertTrue(new_path.endswith('_lego.gif'))
def test_get_new_filename(self): '''Test the default output filename generation''' # Is the generated path in the same directory? new_path = legofy.get_new_filename(FLOWER_PATH) self.assertTrue( os.path.dirname(FLOWER_PATH) == os.path.dirname(new_path)) # Is the generated path unique? self.assertFalse(os.path.exists(new_path), "Should not find image : {0}".format(new_path)) # Test default file extensions self.assertTrue(new_path.endswith('_lego.jpg')) new_path = legofy.get_new_filename(FLOWER_PATH, '.gif') self.assertTrue(new_path.endswith('_lego.gif'))
def test_get_new_filename(self): '''Test the default output filename generation''' # Is the generated path in the same directory? new_path = legofy.get_new_filename(FLOWER_PATH) self.assertTrue(os.path.dirname(FLOWER_PATH) == os.path.dirname(new_path)) # Is the generated path unique? self.assertFalse(os.path.exists(new_path), "Should not find image : {0}".format(new_path)) # Test default file extensions self.assertTrue(new_path.endswith('_lego.jpg')) new_path = legofy.get_new_filename(FLOWER_PATH, '.gif') self.assertTrue(new_path.endswith('_lego.gif'))