class FlickrServiceTest(unittest.TestCase): def setUp(self): self.flickr = FlickrService("*****@*****.**", "KCClassTest") def tearDown(self): pass def test_publish_and_unpublish(self): # publish a sample video. publish_metadata = PublishMetadata(title="Marko KCClass test.", description="Marko's test image for the KC Class project.", tags=["Marko", "kcclass"], category="KCClass", access=Access.PUBLIC) #image_id = self.flickr.publish("../../sample-data/test-image1.jpg", publish_metadata) image_id = self.flickr.publish("/tmp/test-image1.jpg", publish_metadata) self.assertTrue(image_id is not None, "Image publishing failed!") # list the uploaded videos. #photos = self.flickr.list("KCClass") photos = self.flickr.list() self.assertTrue(len(photos) > 0, "Number of published photos should be greater than 0.") # unpublish the video that was just published. self.flickr.unpublish(image_id)
def setUp(self): self.flickr = FlickrService("*****@*****.**", "KCClassTest")