示例#1
0
    def test_oembed_album_picasa(self):
        from app import oembed_album, albumname2id

        self.mock_data("5064748777194404169", "album_picasa.json")

        url_ = "https://picasaweb.google.com/111415681122206252267/Sasha02"
        input_ = {}
        input_["userid"], input_["albumname"] = searches.ALBUMNAME_ONLY_EXTRACT.search(url_).groups()

        input_["albumid"] = albumname2id(input_)
        input_["maxwidth"] = 640
        input_["maxheight"] = 480

        self.assertEqual(oembed_album(input_), self.load_data("result_album_picasa.json"))
示例#2
0
    def test_oembed_single_picasa_video(self):
        from app import oembed_single, albumname2id

        self.mock_data('5064748777194404144', 'single_picasa_video.json')

        url_ = """https://picasaweb.google.com/111415681122206252267/August31201202#5782876989650158754"""
        input_ = {}
        input_['userid'], input_['albumname'], input_['photoid'] = \
            searches.ALBUMNAME_PHOTO_EXTRACT.search(url_).groups()

        input_['albumid'] = albumname2id(input_)
        input_['maxwidth'] = 640
        input_['maxheight'] = 480
        self.assertEqual(oembed_single(input_),
                         self.load_data('result_single_picasa_video.json'))
示例#3
0
    def test_oembed_single_picasa_video(self):
        from app import oembed_single, albumname2id

        self.mock_data("5064748777194404144", "single_picasa_video.json")

        url_ = """https://picasaweb.google.com/111415681122206252267/August31201202#5782876989650158754"""
        input_ = {}
        input_["userid"], input_["albumname"], input_["photoid"] = searches.ALBUMNAME_PHOTO_EXTRACT.search(
            url_
        ).groups()

        input_["albumid"] = albumname2id(input_)
        input_["maxwidth"] = 640
        input_["maxheight"] = 480
        self.assertEqual(oembed_single(input_), self.load_data("result_single_picasa_video.json"))
示例#4
0
    def test_oembed_album_picasa(self):
        from app import oembed_album, albumname2id

        self.mock_data('5064748777194404169', 'album_picasa.json')

        url_ = "https://picasaweb.google.com/111415681122206252267/Sasha02"
        input_ = {}
        input_['userid'], input_['albumname'] = \
            searches.ALBUMNAME_ONLY_EXTRACT.search(url_).groups()

        input_['albumid'] = albumname2id(input_)
        input_['maxwidth'] = 640
        input_['maxheight'] = 480

        self.assertEqual(oembed_album(input_),
                         self.load_data('result_album_picasa.json'))