Esempio n. 1
0
class TestFeed(TestCase):
    def setUp(self):
        options = {"url": "http://www.gravatar.com/avatar/0?d=mm"}
        self.connection = Camera(options)
        self.camera = Feed(options, self.connection)

    def test_get_url(self):
        """
        Test that the url of the image is returned.
        """
        self.assertEqual(self.camera.get_url(),
                         "http://www.gravatar.com/avatar/0?d=mm")

    def tearDown(self):
        """
        Clean up by removing the test image that was downloaded.
        """
        if os.path.exists(self.connection.cache_directory):
            shutil.rmtree(self.connection.cache_directory)
Esempio n. 2
0
class TestFeed(TestCase):

    def setUp(self):
        options = {
            "url": "http://www.gravatar.com/avatar/0?d=mm"
        }
        self.connection = Camera(options)
        self.camera = Feed(options, self.connection)

    def test_get_url(self):
        """
        Test that the url of the image is returned.
        """
        self.assertEqual(
            self.camera.get_url(),
            "http://www.gravatar.com/avatar/0?d=mm"
        )

    def tearDown(self):
        """
        Clean up by removing the test image that was downloaded.
        """
        if os.path.exists(self.connection.cache_directory):
            shutil.rmtree(self.connection.cache_directory)
Esempio n. 3
0
 def setUp(self):
     options = {
         "url": "http://www.gravatar.com/avatar/0?d=mm"
     }
     self.connection = Camera(options)
     self.camera = Feed(options, self.connection)
Esempio n. 4
0
 def setUp(self):
     options = {"url": "http://www.gravatar.com/avatar/0?d=mm"}
     self.connection = Camera(options)
     self.camera = Feed(options, self.connection)