예제 #1
0
 def test_delete_gist(self):
     gist = allhub.create_gist([named_file.name],
                               "Create a gist",
                               public=True)
     assert allhub.response.status_code == 201
     assert gist.owner.login == allhub.username
     assert allhub.delete_gist(gist.id)
예제 #2
0
 def test_gist_commits(self):
     description = "Create a gist"
     modified_description = "Modified the created gist"
     gist = allhub.create_gist([named_file.name], description, public=True)
     edited_gist = allhub.edit_gist(gist.id, [named_file.name],
                                    modified_description)
     assert len(allhub.gist_commits(edited_gist.id)) == 2
     assert allhub.delete_gist(edited_gist.id)
예제 #3
0
 def test_edit_gist(self):
     gist = allhub.create_gist([named_file.name],
                               "Create a gist",
                               public=False)
     assert allhub.response.status_code == 201
     assert gist.owner.login == allhub.username
     edited_gist = allhub.edit_gist(gist.id, [named_file.name],
                                    "Modified the Created gist")
     assert allhub.response.status_code == 200
     assert edited_gist.owner.login == allhub.username
     new_gist = allhub.gist(edited_gist.id)
     assert new_gist.description == "Modified the Created gist"
     assert allhub.delete_gist(gist.id)
예제 #4
0
 def test_gist_create_comment(self):
     description = "Create a gist"
     comment = "this is the first comment."
     edited_comment = "This is the edited comment"
     gist = allhub.create_gist([named_file.name], description, public=True)
     comment_obj = allhub.create_gist_comment(gist.id, comment)
     assert allhub.response.status_code == 201
     assert comment_obj.body == comment
     comment_obj = allhub.gist_comment(gist.id, comment_obj.id)
     assert comment_obj.body == comment
     comment_obj = allhub.edit_gist_comment(gist.id, comment_obj.id,
                                            edited_comment)
     comment_obj = allhub.gist_comment(gist.id, comment_obj.id)
     assert comment_obj.body == edited_comment
     assert allhub.delete_gist_comment(gist.id, comment_obj.id)
예제 #5
0
 def test_gist_revision(self):
     description = "Create a gist"
     modified_description = "Modified the created gist"
     gist = allhub.create_gist([named_file.name], description, public=True)
     edited_gist = allhub.edit_gist(gist.id, [named_file.name],
                                    modified_description)
     gist = allhub.gist_revision(edited_gist.id,
                                 edited_gist.history[1].version)
     assert gist.description == modified_description
     gist = allhub.gist_revision(edited_gist.id,
                                 edited_gist.history[0].version)
     # TODO: Shouldn't i get the starting description.
     assert gist.description == modified_description
     gist = allhub.gist(edited_gist.id)
     assert gist.description == modified_description
     assert allhub.delete_gist(gist.id)
예제 #6
0
 def test_gists(self):
     allhub.create_gist([named_file.name], "Create a gist", public=True)
     gists = allhub.gists()
     for gist in gists:
         assert allhub.delete_gist(gist.id)