Add missing properties to Repository (#842)

Closes #784
Closes #785

First commit fixes a small bug that I observed while trying to record some new test fixtures: the stringification of the headers is not correctly printed as a list of tuples, but as an `iteritems` object, so I forced the list evaluation.

Second commit adds the missing properties `allow_merge_commit`, `allow_rebase_merge`, `allow_squash_merge`, and `has_projects` to the `Repository` class.

Note however that I ran into some trouble while modifying the `edit` method of the `Repository` class to make use of the new properties, specifically while writing tests, so I will fix the `edit` method in a future PR.
This commit is contained in:
Jacopo Notarstefano
2018-07-13 12:02:53 +08:00
committed by Wan Liuyang
parent 1a90f5db5d
commit 2b352fb397
6 changed files with 59 additions and 10 deletions
+2 -1
View File
@@ -13,6 +13,7 @@
# Copyright 2017 Hugo <hugovk@users.noreply.github.com> #
# Copyright 2017 Simon <spam@esemi.ru> #
# Copyright 2018 sfdye <tsfdye@gmail.com> #
# Copyright 2018 Jacopo Notarstefano <jacopo.notarstefano@gmail.com> #
# #
# This file is part of PyGithub. #
# http://pygithub.readthedocs.io/ #
@@ -115,7 +116,7 @@ class RecordingConnection: # pragma no cover (Class useful only when recording
output = res.read()
self.__writeLine(str(status))
self.__writeLine(str(headers))
self.__writeLine(str(list(headers)))
if atLeastPython3: # In Py3, return from "read" is bytes
self.__writeLine(output)
else: