Exemplo n.º 1
0
class Test_photo_stream(unittest.TestCase):
    """ This tests the photo_stream class. """
    
    def setUp(self):
        self.test_settings = test_settings
        self.popular_photos = PhotoStream()
    
    def test_init(self):
        self.assertTrue(self.popular_photos.first().name)
        
    def test_photo_is_actually_popular(self):
        self.assertTrue(self.popular_photos.first().rating > 99.0)
Exemplo n.º 2
0
from fhp.models.photo_stream import PhotoStream
import subprocess
import os

p = PhotoStream("editors")

MAX = (1000 * 1000)
i = 0

for photo in p:
    if os.path.isfile("photos/%s.jpg" % photo.id):
        continue

    i += 1
    if i > MAX:
        break
    url = photo.image_url_size(100)
    process_call = "wget --output-document=photos/%s.jpg %s" % (photo.id, url)
    subprocess.call(process_call, shell=True)
Exemplo n.º 3
0
from fhp.models.photo_stream import PhotoStream
import subprocess
import os

p = PhotoStream()

MAX = (1000 * 1000)
i = 0

for photo in p:
    if os.path.isfile("photos/%s.jpg" % photo.id):
        continue

    i += 1
    if i > MAX:
        break
    url = photo.image_url_size(100)
    process_call = "wget --output-document=photos/%s.jpg %s" % (photo.id, url)
    subprocess.call(process_call, shell=True)
Exemplo n.º 4
0
 def setUp(self):
     self.test_settings = test_settings
     self.popular_photos = PhotoStream()