picasa 0.5.4 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/.travis.yml +4 -9
- data/Gemfile +4 -4
- data/README.md +4 -12
- data/extra/Thorfile +0 -3
- data/lib/picasa.rb +1 -8
- data/lib/picasa/api/album.rb +11 -11
- data/lib/picasa/api/base.rb +0 -3
- data/lib/picasa/api/comment.rb +6 -8
- data/lib/picasa/api/photo.rb +9 -9
- data/lib/picasa/api/tag.rb +6 -8
- data/lib/picasa/client.rb +2 -2
- data/lib/picasa/connection.rb +14 -51
- data/lib/picasa/exceptions.rb +1 -0
- data/lib/picasa/file.rb +8 -0
- data/lib/picasa/http.rb +28 -0
- data/lib/picasa/presenter/album.rb +15 -15
- data/lib/picasa/presenter/album_list.rb +10 -10
- data/lib/picasa/presenter/comment.rb +6 -6
- data/lib/picasa/presenter/comment_list.rb +10 -10
- data/lib/picasa/presenter/media.rb +5 -5
- data/lib/picasa/presenter/photo.rb +15 -15
- data/lib/picasa/presenter/tag.rb +3 -3
- data/lib/picasa/presenter/tag_list.rb +10 -10
- data/lib/picasa/utils.rb +11 -13
- data/lib/picasa/version.rb +1 -1
- data/picasa.gemspec +2 -1
- data/test/api/album_test.rb +163 -20
- data/test/api/comment_test.rb +95 -10
- data/test/api/photo_test.rb +27 -11
- data/test/api/tag_test.rb +84 -13
- data/test/cassettes/album-404.yml +52 -0
- data/test/cassettes/album-create.yml +107 -0
- data/test/cassettes/album-destroy.yml +55 -0
- data/test/cassettes/album-list.yml +85 -0
- data/test/cassettes/album-show.yml +123 -0
- data/test/cassettes/auth-failed.yml +50 -0
- data/test/cassettes/auth-success.yml +64 -0
- data/test/cassettes/comment-400.yml +56 -0
- data/test/cassettes/comment-create.yml +88 -0
- data/test/cassettes/comment-destroy.yml +53 -0
- data/test/cassettes/comment-list.yml +87 -0
- data/test/cassettes/photo-412.yml +58 -0
- data/test/cassettes/photo-create.yml +1908 -0
- data/test/cassettes/photo-destroy.yml +55 -0
- data/test/cassettes/tag-create.yml +85 -0
- data/test/cassettes/tag-destroy.yml +53 -0
- data/test/cassettes/tag-list.yml +79 -0
- data/test/client_test.rb +10 -10
- data/test/connection_test.rb +0 -35
- data/test/helper.rb +21 -7
- data/test/utils_test.rb +0 -6
- metadata +37 -40
- data/test/fixtures/album/album-create.txt +0 -21
- data/test/fixtures/album/album-list-with-tag.txt +0 -105
- data/test/fixtures/album/album-list.txt +0 -105
- data/test/fixtures/album/album-show-with-max-results.txt +0 -131
- data/test/fixtures/album/album-show-with-tag-and-many-photos.txt +0 -156
- data/test/fixtures/album/album-show-with-tag-and-one-photo.txt +0 -105
- data/test/fixtures/album/album-show.txt +0 -169
- data/test/fixtures/auth/success.txt +0 -14
- data/test/fixtures/comment/comment-list.txt +0 -65
- data/test/fixtures/exceptions/forbidden.txt +0 -12
- data/test/fixtures/exceptions/not_found.txt +0 -14
- data/test/fixtures/exceptions/precondition_failed.txt +0 -14
- data/test/fixtures/json.txt +0 -435
- data/test/fixtures/photo/photo-created.txt +0 -21
- data/test/fixtures/photo/photo-list-all-with-q.txt +0 -556
- data/test/fixtures/photo/photo-list-all.txt +0 -623
- data/test/fixtures/photo/photo-list-user.txt +0 -388
- data/test/fixtures/presenters/album_list.xml +0 -88
- data/test/fixtures/presenters/album_show.xml +0 -152
- data/test/fixtures/presenters/album_show_with_one_photo.xml +0 -88
- data/test/fixtures/presenters/comment_list.xml +0 -48
- data/test/fixtures/presenters/tag_list.xml +0 -51
- data/test/fixtures/tag/tag-list.txt +0 -68
- data/test/presenter/album_list_test.rb +0 -67
- data/test/presenter/album_test.rb +0 -189
- data/test/presenter/author_test.rb +0 -17
- data/test/presenter/base_test.rb +0 -50
- data/test/presenter/comment_list_test.rb +0 -67
- data/test/presenter/comment_test.rb +0 -56
- data/test/presenter/content_test.rb +0 -18
- data/test/presenter/link_test.rb +0 -21
- data/test/presenter/media_test.rb +0 -29
- data/test/presenter/photo_test.rb +0 -90
- data/test/presenter/tag_list_test.rb +0 -67
- data/test/presenter/tag_test.rb +0 -48
- data/test/presenter/thumbnail_test.rb +0 -24
@@ -1,90 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
require "helper"
|
3
|
-
|
4
|
-
describe Picasa::Presenter::Photo do
|
5
|
-
before do
|
6
|
-
body = MultiXml.parse(fixture("presenters/album_show.xml"))
|
7
|
-
@photo = Picasa::Presenter::Photo.new(body["feed"]["entry"][0])
|
8
|
-
end
|
9
|
-
|
10
|
-
it "has links" do
|
11
|
-
assert_equal 5, @photo.links.size
|
12
|
-
end
|
13
|
-
|
14
|
-
it "has content src" do
|
15
|
-
expected = "https://lh4.googleusercontent.com/-O0AOpTAPGBQ/SMU_j4ADl9I/AAAAAAAAAFs/DRnmROPuRVU/Kashmir%252520range.jpg"
|
16
|
-
assert_equal expected, @photo.content.src
|
17
|
-
end
|
18
|
-
|
19
|
-
it "has media credit" do
|
20
|
-
assert_equal "Wojciech Wnętrzak", @photo.media.credit
|
21
|
-
end
|
22
|
-
|
23
|
-
it "has etag" do
|
24
|
-
assert_equal "\"YD4qeyI.\"", @photo.etag
|
25
|
-
end
|
26
|
-
|
27
|
-
it "has id" do
|
28
|
-
assert_equal "5243667226703402962", @photo.id
|
29
|
-
end
|
30
|
-
|
31
|
-
it "has published" do
|
32
|
-
assert_equal "2008-09-08T15:06:55+00:00", @photo.published.to_s
|
33
|
-
end
|
34
|
-
|
35
|
-
it "has updated" do
|
36
|
-
assert_equal "2009-06-24T15:59:48+00:00", @photo.updated.to_s
|
37
|
-
end
|
38
|
-
|
39
|
-
it "has title" do
|
40
|
-
assert_equal "Kashmir range.jpg", @photo.title
|
41
|
-
end
|
42
|
-
|
43
|
-
it "has summary" do
|
44
|
-
assert_nil @photo.summary
|
45
|
-
end
|
46
|
-
|
47
|
-
it "has album_id" do
|
48
|
-
assert_equal "5243667126168669553", @photo.album_id
|
49
|
-
end
|
50
|
-
|
51
|
-
it "has access" do
|
52
|
-
assert_equal "public", @photo.access
|
53
|
-
end
|
54
|
-
|
55
|
-
it "has width" do
|
56
|
-
assert_equal 717, @photo.width
|
57
|
-
end
|
58
|
-
|
59
|
-
it "has height" do
|
60
|
-
assert_equal 468, @photo.height
|
61
|
-
end
|
62
|
-
|
63
|
-
it "has size" do
|
64
|
-
assert_equal 79465, @photo.size
|
65
|
-
end
|
66
|
-
|
67
|
-
it "has checksum" do
|
68
|
-
assert_nil @photo.checksum
|
69
|
-
end
|
70
|
-
|
71
|
-
it "has timestamp" do
|
72
|
-
assert_equal "1220886415000", @photo.timestamp
|
73
|
-
end
|
74
|
-
|
75
|
-
it "has image_version" do
|
76
|
-
assert_equal 91, @photo.image_version
|
77
|
-
end
|
78
|
-
|
79
|
-
it "has commenting_enabled" do
|
80
|
-
assert_equal true, @photo.commenting_enabled
|
81
|
-
end
|
82
|
-
|
83
|
-
it "has comment_count" do
|
84
|
-
assert_equal 0, @photo.comment_count
|
85
|
-
end
|
86
|
-
|
87
|
-
it "has license" do
|
88
|
-
assert_equal "ALL_RIGHTS_RESERVED", @photo.license
|
89
|
-
end
|
90
|
-
end
|
@@ -1,67 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
require "helper"
|
3
|
-
|
4
|
-
describe Picasa::Presenter::TagList do
|
5
|
-
before do
|
6
|
-
body = MultiXml.parse(fixture("presenters/tag_list.xml"))
|
7
|
-
@tag_list = Picasa::Presenter::TagList.new(body["feed"])
|
8
|
-
end
|
9
|
-
|
10
|
-
it "has author name" do
|
11
|
-
assert_equal "Wojciech Wnętrzak", @tag_list.author.name
|
12
|
-
end
|
13
|
-
|
14
|
-
it "has author uri" do
|
15
|
-
assert_equal "https://picasaweb.google.com/106136347770555028022", @tag_list.author.uri
|
16
|
-
end
|
17
|
-
|
18
|
-
it "has links" do
|
19
|
-
assert_equal 4, @tag_list.links.size
|
20
|
-
end
|
21
|
-
|
22
|
-
it "has title" do
|
23
|
-
assert_equal "106136347770555028022", @tag_list.title
|
24
|
-
end
|
25
|
-
|
26
|
-
it "has updated" do
|
27
|
-
assert_equal "2012-08-17T08:40:24+00:00", @tag_list.updated.to_s
|
28
|
-
end
|
29
|
-
|
30
|
-
it "has icon" do
|
31
|
-
expected = "https://lh3.googleusercontent.com/-6ezHc54U8x0/AAAAAAAAAAI/AAAAAAAAAAA/PBuxm7Ehn6E/s64-c/106136347770555028022.jpg"
|
32
|
-
assert_equal expected, @tag_list.icon
|
33
|
-
end
|
34
|
-
|
35
|
-
it "has generator" do
|
36
|
-
assert_equal "Picasaweb", @tag_list.generator
|
37
|
-
end
|
38
|
-
|
39
|
-
it "has total_results" do
|
40
|
-
assert_equal 2, @tag_list.total_results
|
41
|
-
end
|
42
|
-
|
43
|
-
it "has start_index" do
|
44
|
-
assert_equal 1, @tag_list.start_index
|
45
|
-
end
|
46
|
-
|
47
|
-
it "has items_per_page" do
|
48
|
-
assert_equal 500, @tag_list.items_per_page
|
49
|
-
end
|
50
|
-
|
51
|
-
it "has user" do
|
52
|
-
assert_equal "106136347770555028022", @tag_list.user
|
53
|
-
end
|
54
|
-
|
55
|
-
it "has nickname" do
|
56
|
-
assert_equal "Wojciech Wnętrzak", @tag_list.nickname
|
57
|
-
end
|
58
|
-
|
59
|
-
it "has thumbnail" do
|
60
|
-
expected = "https://lh3.googleusercontent.com/-6ezHc54U8x0/AAAAAAAAAAI/AAAAAAAAAAA/PBuxm7Ehn6E/s64-c/106136347770555028022.jpg"
|
61
|
-
assert_equal expected, @tag_list.thumbnail
|
62
|
-
end
|
63
|
-
|
64
|
-
it "has entries" do
|
65
|
-
assert_equal 2, @tag_list.entries.size
|
66
|
-
end
|
67
|
-
end
|
data/test/presenter/tag_test.rb
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
require "helper"
|
3
|
-
|
4
|
-
describe Picasa::Presenter::Tag do
|
5
|
-
describe "album from album list" do
|
6
|
-
before do
|
7
|
-
body = MultiXml.parse(fixture("presenters/tag_list.xml"))
|
8
|
-
@tag = Picasa::Presenter::Tag.new(body["feed"]["entry"][0])
|
9
|
-
end
|
10
|
-
|
11
|
-
it "has author name" do
|
12
|
-
assert_equal "Wojciech Wnętrzak", @tag.author.name
|
13
|
-
end
|
14
|
-
|
15
|
-
it "has author uri" do
|
16
|
-
assert_equal "https://picasaweb.google.com/106136347770555028022", @tag.author.uri
|
17
|
-
end
|
18
|
-
|
19
|
-
it "has links" do
|
20
|
-
assert_equal 2, @tag.links.size
|
21
|
-
end
|
22
|
-
|
23
|
-
it "has updated" do
|
24
|
-
assert_equal "2012-08-17T08:40:24+00:00", @tag.updated.to_s
|
25
|
-
end
|
26
|
-
|
27
|
-
it "has etag" do
|
28
|
-
assert_equal "W/\"CE8GRXczfip7ImA9WhJWEUQ.\"", @tag.etag
|
29
|
-
end
|
30
|
-
|
31
|
-
it "has title" do
|
32
|
-
assert_equal "nice", @tag.title
|
33
|
-
end
|
34
|
-
|
35
|
-
it "has summary" do
|
36
|
-
assert_equal "nice", @tag.summary
|
37
|
-
end
|
38
|
-
|
39
|
-
it "has id" do
|
40
|
-
expected = "https://picasaweb.google.com/data/entry/user/106136347770555028022/tag/nice"
|
41
|
-
assert_equal expected, @tag.id
|
42
|
-
end
|
43
|
-
|
44
|
-
it "has weight" do
|
45
|
-
assert_equal 2, @tag.weight
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
require "helper"
|
3
|
-
|
4
|
-
describe Picasa::Presenter::Thumbnail do
|
5
|
-
describe "album list" do
|
6
|
-
before do
|
7
|
-
body = MultiXml.parse(fixture("presenters/album_list.xml"))
|
8
|
-
@thumbnail = Picasa::Presenter::Thumbnail.new(body["feed"]["entry"][0]["group"]["thumbnail"])
|
9
|
-
end
|
10
|
-
|
11
|
-
it "has url" do
|
12
|
-
expected = "https://lh6.googleusercontent.com/-u_2FJXbbliU/SMU_eBetTXE/AAAAAAAAAkU/3XThNVnAM-4/s160-c/Test2.jpg"
|
13
|
-
assert_equal expected, @thumbnail.url
|
14
|
-
end
|
15
|
-
|
16
|
-
it "has height" do
|
17
|
-
assert_equal 160, @thumbnail.height
|
18
|
-
end
|
19
|
-
|
20
|
-
it "has width" do
|
21
|
-
assert_equal 160, @thumbnail.width
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|