Skip to content

Commit 75a8dc6

Browse files
committed
as probably 500px stopped providing blog API, I do comment out the API and test cases
1 parent 0be69ff commit 75a8dc6

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

fivehundredpx/client.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ def upload_photo(self, filename=None,fp=None,file_type=None, **kwargs):
5656
blogs = bind_api(path='/blogs')
5757
blogs_id = bind_api(path='/blogs/{id}', allowed_params=['id'])
5858
blogs_comments = bind_api(path='/blogs/{id}/comments', allowed_params=['id'])
59-
blogs_comments_post = bind_api(path='/blogs/{id}/comments', require_auth=True, allowed_params=['id'], method='POST')
60-
blogs_post = bind_api(path='/blogs', require_auth=True, method='POST')
61-
blogs_update = bind_api(path='/blogs/{id}', require_auth=True, allowed_params=['id'], method='PUT')
62-
blogs_delete = bind_api(path='/blogs/{id}', require_auth=True, allowed_params=['id'], method='DELETE')
63-
59+
# blogs_comments_post = bind_api(path='/blogs/{id}/comments', require_auth=True, allowed_params=['id'], method='POST')
60+
# blogs_post = bind_api(path='/blogs', require_auth=True, method='POST')
61+
# blogs_update = bind_api(path='/blogs/{id}', require_auth=True, allowed_params=['id'], method='PUT')
62+
# blogs_delete = bind_api(path='/blogs/{id}', require_auth=True, allowed_params=['id'], method='DELETE')
63+
6464
#### Comment API
6565
# https://github.com/500px/api-documentation/tree/master/endpoints/comments
6666
comments_post = bind_api(path='/comments/{id}/comments', require_auth=True, allowed_params=['id'], method='POST')

tests/blog.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,28 @@ def test_blogs(self):
2525
for blog in json['blog_posts']:
2626
json = self.api.blogs_id(require_auth=True, id=blog['id'])
2727
self.assertIsNotNone(json)
28-
json = self.api.blogs_comments(require_auth=True, id=blog['id'])
28+
json = self.api.blogs_comments(require_auth=True, id=blog['id'])
2929
self.assertIsNotNone(json)
3030

31-
def test_blog(self):
32-
json = self.api.blogs_post(title='title test', body='body test')
33-
self.assertIsNotNone(json)
34-
35-
json = self.api.blogs_update(id=json['id'], title='title test 2', body='body test 2')
36-
self.assertIsNotNone(json)
37-
38-
json_comment = self.api.blogs_comments_post(id=json['id'], body='test comment')
39-
self.assertIsNotNone(json_comment)
40-
41-
blogs = self.api.blogs_comments(id=json['id'])
42-
self.assertIsNotNone(blogs)
43-
44-
json_comment = self.api.comments_post(id=json_comment['comment']['id'], body='reply test comment')
45-
self.assertIsNotNone(json_comment)
46-
47-
json = self.api.blogs_delete(id=json['id'])
48-
self.assertIsNotNone(json)
31+
# def test_blog(self):
32+
# json = self.api.blogs_post(title='title test', body='body test')
33+
# self.assertIsNotNone(json)
34+
#
35+
# json = self.api.blogs_update(id=json['id'], title='title test 2', body='body test 2')
36+
# self.assertIsNotNone(json)
37+
#
38+
# json_comment = self.api.blogs_comments_post(id=json['id'], body='test comment')
39+
# self.assertIsNotNone(json_comment)
40+
#
41+
# blogs = self.api.blogs_comments(id=json['id'])
42+
# self.assertIsNotNone(blogs)
43+
#
44+
# json_comment = self.api.comments_post(id=json_comment['comment']['id'], body='reply test comment')
45+
# self.assertIsNotNone(json_comment)
46+
#
47+
# json = self.api.blogs_delete(id=json['id'])
48+
# self.assertIsNotNone(json)
4949

5050
if __name__ == '__main__':
5151
del sys.argv[1:]
52-
unittest.main()
52+
unittest.main()

0 commit comments

Comments
 (0)