{"action":"created","comment":{"url":"https://api.github.com/repos/smartfile/client-python/pulls/comments/64641003","id":64641003,"diff_hunk":"@@ -0,0 +1,49 @@\n+import os\n+import unittest\n+\n+from smartfile import BasicClient\n+\n+API_KEY = os.environ.get(\"API_KEY\")\n+API_PASSWORD = os.environ.get(\"API_PASSWORD\")\n+\n+if API_KEY is None:\n+    raise RuntimeError(\"API_KEY is required\")\n+    \n+if API_PASSWORD is None:\n+    raise RuntimeError(\"API_PASSWORD is required\")\n+    \n+\n+class CustomOperationsTestCase(unittest.TestCase): \n+    \n+    def setUp(self):\n+        self.current_dir = os.path.dirname(os.path.realpath(__file__)) + \"/\"\n+        self.api = BasicClient(API_KEY, API_PASSWORD)\n+        self.txtfile = self.current_dir + \"resources/myfile.txt\"\n+        self.uploaddata = None\n+    \n+    def get_data(self):\n+        self.uploaddata = self.api.get(\"/path/info/myfile.txt\")\n+        return self.uploaddata\n+        \n+    def upload(self):\n+        data = open(self.txtfile, \"rb\")\n+        newfile = ('myfile.txt', data)\n+        self.api.upload(newfile)\n+        self.assertEquals(self.get_data()['size'], os.path.getsize(self.txtfile))\n+        \n+    def download(self): \n+        f = self.api.download(\"myfile.txt\")\n+        self.assertEquals(f.readlines(), open(self.txtfile, \"rb\").readlines())\n+    \n+    def move(self):\n+        self.api.move('myfile.txt', '/newFolder/')\n+        \n+    def delete(self):\n+        self.api.delete(\"/newFolder/myfile.txt\")\n+        self.assertRaises(Exception, BasicClient.delete) \n+        \n+    def test_upload_download_move_delete_clean_up(self):\n+        self.upload()\n+        self.download()\n+        self.move()\n+        self.delete()","path":"test/test_smartfile.py","position":50,"original_position":49,"commit_id":"16359a31904afd05bfa1ed206b095071cba3a31d","original_commit_id":"d9a29f89924b52399a2d6d16f1016d0376ee8f21","user":{"login":"jnemery","id":17328929,"avatar_url":"https://avatars.githubusercontent.com/u/17328929?v=3","gravatar_id":"","url":"https://api.github.com/users/jnemery","html_url":"https://github.com/jnemery","followers_url":"https://api.github.com/users/jnemery/followers","following_url":"https://api.github.com/users/jnemery/following{/other_user}","gists_url":"https://api.github.com/users/jnemery/gists{/gist_id}","starred_url":"https://api.github.com/users/jnemery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jnemery/subscriptions","organizations_url":"https://api.github.com/users/jnemery/orgs","repos_url":"https://api.github.com/users/jnemery/repos","events_url":"https://api.github.com/users/jnemery/events{/privacy}","received_events_url":"https://api.github.com/users/jnemery/received_events","type":"User","site_admin":false},"body":"Added new line :100: ","created_at":"2016-05-25T19:49:51Z","updated_at":"2016-05-25T19:49:51Z","html_url":"https://github.com/smartfile/client-python/pull/7#discussion_r64641003","pull_request_url":"https://api.github.com/repos/smartfile/client-python/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/smartfile/client-python/pulls/comments/64641003"},"html":{"href":"https://github.com/smartfile/client-python/pull/7#discussion_r64641003"},"pull_request":{"href":"https://api.github.com/repos/smartfile/client-python/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/smartfile/client-python/pulls/7","id":71280768,"html_url":"https://github.com/smartfile/client-python/pull/7","diff_url":"https://github.com/smartfile/client-python/pull/7.diff","patch_url":"https://github.com/smartfile/client-python/pull/7.patch","issue_url":"https://api.github.com/repos/smartfile/client-python/issues/7","number":7,"state":"open","locked":false,"title":"Python SDK update. #3685","user":{"login":"jnemery","id":17328929,"avatar_url":"https://avatars.githubusercontent.com/u/17328929?v=3","gravatar_id":"","url":"https://api.github.com/users/jnemery","html_url":"https://github.com/jnemery","followers_url":"https://api.github.com/users/jnemery/followers","following_url":"https://api.github.com/users/jnemery/following{/other_user}","gists_url":"https://api.github.com/users/jnemery/gists{/gist_id}","starred_url":"https://api.github.com/users/jnemery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jnemery/subscriptions","organizations_url":"https://api.github.com/users/jnemery/orgs","repos_url":"https://api.github.com/users/jnemery/repos","events_url":"https://api.github.com/users/jnemery/events{/privacy}","received_events_url":"https://api.github.com/users/jnemery/received_events","type":"User","site_admin":false},"body":"Implemented move, delete, upload, download methods.\r\n\r\nUpdated README documentation on how to perform these tasks.\r\n\r\nImplemented testing for these tasks.","created_at":"2016-05-24T19:44:27Z","updated_at":"2016-05-25T19:49:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4d4f6d34bb4258f0ca826f328a330354df73d8cc","assignee":{"login":"jnemery","id":17328929,"avatar_url":"https://avatars.githubusercontent.com/u/17328929?v=3","gravatar_id":"","url":"https://api.github.com/users/jnemery","html_url":"https://github.com/jnemery","followers_url":"https://api.github.com/users/jnemery/followers","following_url":"https://api.github.com/users/jnemery/following{/other_user}","gists_url":"https://api.github.com/users/jnemery/gists{/gist_id}","starred_url":"https://api.github.com/users/jnemery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jnemery/subscriptions","organizations_url":"https://api.github.com/users/jnemery/orgs","repos_url":"https://api.github.com/users/jnemery/repos","events_url":"https://api.github.com/users/jnemery/events{/privacy}","received_events_url":"https://api.github.com/users/jnemery/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/smartfile/client-python/pulls/7/commits","review_comments_url":"https://api.github.com/repos/smartfile/client-python/pulls/7/comments","review_comment_url":"https://api.github.com/repos/smartfile/client-python/pulls/comments{/number}","comments_url":"https://api.github.com/repos/smartfile/client-python/issues/7/comments","statuses_url":"https://api.github.com/repos/smartfile/client-python/statuses/16359a31904afd05bfa1ed206b095071cba3a31d","head":{"label":"smartfile:sdk-update","ref":"sdk-update","sha":"16359a31904afd05bfa1ed206b095071cba3a31d","user":{"login":"smartfile","id":2232208,"avatar_url":"https://avatars.githubusercontent.com/u/2232208?v=3","gravatar_id":"","url":"https://api.github.com/users/smartfile","html_url":"https://github.com/smartfile","followers_url":"https://api.github.com/users/smartfile/followers","following_url":"https://api.github.com/users/smartfile/following{/other_user}","gists_url":"https://api.github.com/users/smartfile/gists{/gist_id}","starred_url":"https://api.github.com/users/smartfile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smartfile/subscriptions","organizations_url":"https://api.github.com/users/smartfile/orgs","repos_url":"https://api.github.com/users/smartfile/repos","events_url":"https://api.github.com/users/smartfile/events{/privacy}","received_events_url":"https://api.github.com/users/smartfile/received_events","type":"Organization","site_admin":false},"repo":{"id":3063735,"name":"client-python","full_name":"smartfile/client-python","owner":{"login":"smartfile","id":2232208,"avatar_url":"https://avatars.githubusercontent.com/u/2232208?v=3","gravatar_id":"","url":"https://api.github.com/users/smartfile","html_url":"https://github.com/smartfile","followers_url":"https://api.github.com/users/smartfile/followers","following_url":"https://api.github.com/users/smartfile/following{/other_user}","gists_url":"https://api.github.com/users/smartfile/gists{/gist_id}","starred_url":"https://api.github.com/users/smartfile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smartfile/subscriptions","organizations_url":"https://api.github.com/users/smartfile/orgs","repos_url":"https://api.github.com/users/smartfile/repos","events_url":"https://api.github.com/users/smartfile/events{/privacy}","received_events_url":"https://api.github.com/users/smartfile/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/smartfile/client-python","description":"SmartFile API Client (Python).","fork":false,"url":"https://api.github.com/repos/smartfile/client-python","forks_url":"https://api.github.com/repos/smartfile/client-python/forks","keys_url":"https://api.github.com/repos/smartfile/client-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/smartfile/client-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/smartfile/client-python/teams","hooks_url":"https://api.github.com/repos/smartfile/client-python/hooks","issue_events_url":"https://api.github.com/repos/smartfile/client-python/issues/events{/number}","events_url":"https://api.github.com/repos/smartfile/client-python/events","assignees_url":"https://api.github.com/repos/smartfile/client-python/assignees{/user}","branches_url":"https://api.github.com/repos/smartfile/client-python/branches{/branch}","tags_url":"https://api.github.com/repos/smartfile/client-python/tags","blobs_url":"https://api.github.com/repos/smartfile/client-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/smartfile/client-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/smartfile/client-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/smartfile/client-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/smartfile/client-python/statuses/{sha}","languages_url":"https://api.github.com/repos/smartfile/client-python/languages","stargazers_url":"https://api.github.com/repos/smartfile/client-python/stargazers","contributors_url":"https://api.github.com/repos/smartfile/client-python/contributors","subscribers_url":"https://api.github.com/repos/smartfile/client-python/subscribers","subscription_url":"https://api.github.com/repos/smartfile/client-python/subscription","commits_url":"https://api.github.com/repos/smartfile/client-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/smartfile/client-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/smartfile/client-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/smartfile/client-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/smartfile/client-python/contents/{+path}","compare_url":"https://api.github.com/repos/smartfile/client-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/smartfile/client-python/merges","archive_url":"https://api.github.com/repos/smartfile/client-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/smartfile/client-python/downloads","issues_url":"https://api.github.com/repos/smartfile/client-python/issues{/number}","pulls_url":"https://api.github.com/repos/smartfile/client-python/pulls{/number}","milestones_url":"https://api.github.com/repos/smartfile/client-python/milestones{/number}","notifications_url":"https://api.github.com/repos/smartfile/client-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/smartfile/client-python/labels{/name}","releases_url":"https://api.github.com/repos/smartfile/client-python/releases{/id}","deployments_url":"https://api.github.com/repos/smartfile/client-python/deployments","created_at":"2011-12-28T16:41:56Z","updated_at":"2016-05-17T09:01:15Z","pushed_at":"2016-05-25T19:48:53Z","git_url":"git://github.com/smartfile/client-python.git","ssh_url":"git@github.com:smartfile/client-python.git","clone_url":"https://github.com/smartfile/client-python.git","svn_url":"https://github.com/smartfile/client-python","homepage":"http://app.smartfile.com/api/","size":221,"stargazers_count":14,"watchers_count":14,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":3,"forks":4,"open_issues":3,"watchers":14,"default_branch":"master"}},"base":{"label":"smartfile:master","ref":"master","sha":"04ff2ce406d98f3a299ab956c476ba27feae8956","user":{"login":"smartfile","id":2232208,"avatar_url":"https://avatars.githubusercontent.com/u/2232208?v=3","gravatar_id":"","url":"https://api.github.com/users/smartfile","html_url":"https://github.com/smartfile","followers_url":"https://api.github.com/users/smartfile/followers","following_url":"https://api.github.com/users/smartfile/following{/other_user}","gists_url":"https://api.github.com/users/smartfile/gists{/gist_id}","starred_url":"https://api.github.com/users/smartfile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smartfile/subscriptions","organizations_url":"https://api.github.com/users/smartfile/orgs","repos_url":"https://api.github.com/users/smartfile/repos","events_url":"https://api.github.com/users/smartfile/events{/privacy}","received_events_url":"https://api.github.com/users/smartfile/received_events","type":"Organization","site_admin":false},"repo":{"id":3063735,"name":"client-python","full_name":"smartfile/client-python","owner":{"login":"smartfile","id":2232208,"avatar_url":"https://avatars.githubusercontent.com/u/2232208?v=3","gravatar_id":"","url":"https://api.github.com/users/smartfile","html_url":"https://github.com/smartfile","followers_url":"https://api.github.com/users/smartfile/followers","following_url":"https://api.github.com/users/smartfile/following{/other_user}","gists_url":"https://api.github.com/users/smartfile/gists{/gist_id}","starred_url":"https://api.github.com/users/smartfile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smartfile/subscriptions","organizations_url":"https://api.github.com/users/smartfile/orgs","repos_url":"https://api.github.com/users/smartfile/repos","events_url":"https://api.github.com/users/smartfile/events{/privacy}","received_events_url":"https://api.github.com/users/smartfile/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/smartfile/client-python","description":"SmartFile API Client (Python).","fork":false,"url":"https://api.github.com/repos/smartfile/client-python","forks_url":"https://api.github.com/repos/smartfile/client-python/forks","keys_url":"https://api.github.com/repos/smartfile/client-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/smartfile/client-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/smartfile/client-python/teams","hooks_url":"https://api.github.com/repos/smartfile/client-python/hooks","issue_events_url":"https://api.github.com/repos/smartfile/client-python/issues/events{/number}","events_url":"https://api.github.com/repos/smartfile/client-python/events","assignees_url":"https://api.github.com/repos/smartfile/client-python/assignees{/user}","branches_url":"https://api.github.com/repos/smartfile/client-python/branches{/branch}","tags_url":"https://api.github.com/repos/smartfile/client-python/tags","blobs_url":"https://api.github.com/repos/smartfile/client-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/smartfile/client-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/smartfile/client-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/smartfile/client-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/smartfile/client-python/statuses/{sha}","languages_url":"https://api.github.com/repos/smartfile/client-python/languages","stargazers_url":"https://api.github.com/repos/smartfile/client-python/stargazers","contributors_url":"https://api.github.com/repos/smartfile/client-python/contributors","subscribers_url":"https://api.github.com/repos/smartfile/client-python/subscribers","subscription_url":"https://api.github.com/repos/smartfile/client-python/subscription","commits_url":"https://api.github.com/repos/smartfile/client-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/smartfile/client-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/smartfile/client-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/smartfile/client-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/smartfile/client-python/contents/{+path}","compare_url":"https://api.github.com/repos/smartfile/client-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/smartfile/client-python/merges","archive_url":"https://api.github.com/repos/smartfile/client-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/smartfile/client-python/downloads","issues_url":"https://api.github.com/repos/smartfile/client-python/issues{/number}","pulls_url":"https://api.github.com/repos/smartfile/client-python/pulls{/number}","milestones_url":"https://api.github.com/repos/smartfile/client-python/milestones{/number}","notifications_url":"https://api.github.com/repos/smartfile/client-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/smartfile/client-python/labels{/name}","releases_url":"https://api.github.com/repos/smartfile/client-python/releases{/id}","deployments_url":"https://api.github.com/repos/smartfile/client-python/deployments","created_at":"2011-12-28T16:41:56Z","updated_at":"2016-05-17T09:01:15Z","pushed_at":"2016-05-25T19:48:53Z","git_url":"git://github.com/smartfile/client-python.git","ssh_url":"git@github.com:smartfile/client-python.git","clone_url":"https://github.com/smartfile/client-python.git","svn_url":"https://github.com/smartfile/client-python","homepage":"http://app.smartfile.com/api/","size":221,"stargazers_count":14,"watchers_count":14,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":3,"forks":4,"open_issues":3,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/smartfile/client-python/pulls/7"},"html":{"href":"https://github.com/smartfile/client-python/pull/7"},"issue":{"href":"https://api.github.com/repos/smartfile/client-python/issues/7"},"comments":{"href":"https://api.github.com/repos/smartfile/client-python/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/smartfile/client-python/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/smartfile/client-python/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/smartfile/client-python/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/smartfile/client-python/statuses/16359a31904afd05bfa1ed206b095071cba3a31d"}}}}
{"actor":{"display_login":"jnemery"}}