예제 #1
0
 def test_fork_gist(self):
     fork = allhub.fork_gist("9620683")
     gist = allhub.gist(fork.id)
     assert allhub.delete_gist(fork.id)
     gist = allhub.gist(fork.id)
     assert gist.message == "Not Found"
     assert allhub.response.status_code == 404
예제 #2
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)
예제 #3
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)
예제 #4
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)
예제 #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)