Files
PyGithub/github/tests/AllTests.py
T
Yossarian King faca4ce1c0 Add support for projects (#854)
Initial solution for [PyGithub support for projects](https://github.com/PyGithub/PyGithub/issues/606) (#606). Adds comprehensive project querying API.

Currently does not support for modifying projects, columns or cards. (I only need this interface for reporting purposes. Of course once I'm done others are more than welcome to add additional features!)

API that was integrated:
https://developer.github.com/v3/projects
https://developer.github.com/v3/projects/columns
https://developer.github.com/v3/projects/cards

Note that the Github project API is in preview mode - it requires a special header in order for requests to be processed, and the API is subject to change without notice.

## Summary
- new classes: Project, ProjectColumn, ProjectCard
- add Organization.get_projects method
- add Repository.get_projects method
- add MainClass.get_project method
- add test cases to exercise all new classes and methods and verify attributes are as expected; replay data is included, recorded (mostly) from my fork of PyGithub
- updated add_attribute script to:
  - use makeXXXAttribute API
  - be able to add to the end of the current set of properties
  - handle both Completable and NonCompletable class types correctly

## Checklist
Not to be merged until these are done:

- [x] remaining Project properties
- [x] remaining ProjectColumn properties
- [x] remaining ProjectCard properties
- [x] support for archived_state parameter when getting cards: all,archived, or not_archived
- [x] get issue from card, not just pull request ("get_content" method?)
- [x] centralize header management for "preview" access to projects API
- [x] add test for retrieving organization projects
- [x] add test for getting issue / pull request content from card
2018-09-11 13:05:16 +08:00

122 lines
4.9 KiB
Python

# -*- coding: utf-8 -*-
############################ Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> #
# Copyright 2013 AKFish <akfish@gmail.com> #
# Copyright 2013 David Farr <david.farr@sap.com> #
# Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2014 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2015 Ed Holland <eholland@alertlogic.com> #
# Copyright 2016 John Eskew <jeskew@edx.org> #
# Copyright 2016 Matthew Neal <meneal@matthews-mbp.raleigh.ibm.com> #
# Copyright 2016 Peter Buckley <dx-pbuckley@users.noreply.github.com> #
# Copyright 2016 Sam Corbett <sam.corbett@cloudsoftcorp.com> #
# Copyright 2017 Aaron Levine <allevin@sandia.gov> #
# Copyright 2017 Nicolas Agustín Torres <nicolastrres@gmail.com> #
# Copyright 2018 Hayden Fuss <wifu1234@gmail.com> #
# Copyright 2018 Shinichi TAMURA <shnch.tmr@gmail.com> #
# Copyright 2018 Steve Kowalik <steven@wedontsleep.org> #
# Copyright 2018 Wan Liuyang <tsfdye@gmail.com> #
# Copyright 2018 sfdye <tsfdye@gmail.com> #
# #
# This file is part of PyGithub. #
# http://pygithub.readthedocs.io/ #
# #
# PyGithub is free software: you can redistribute it and/or modify it under #
# the terms of the GNU Lesser General Public License as published by the Free #
# Software Foundation, either version 3 of the License, or (at your option) #
# any later version. #
# #
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
# details. #
# #
# You should have received a copy of the GNU Lesser General Public License #
# along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
# #
################################################################################
from AuthenticatedUser import *
from Authentication import *
from Authorization import *
from Branch import *
from BranchProtection import *
from Commit import *
from CommitCombinedStatus import *
from CommitComment import *
from CommitStatus import *
from ContentFile import *
from Download import *
from Event import *
from Gist import *
from GistComment import *
from GitBlob import *
from GitCommit import *
from Github_ import *
from GitRef import *
from GitRelease import *
from GitReleaseAsset import *
from GitTag import *
from GitTree import *
from Hook import *
from Issue import *
from IssueComment import *
from Reaction import *
from IssueEvent import *
from License import *
from Label import *
from Milestone import *
from NamedUser import *
from Markdown import *
from OrganizationHasInMembers import *
from Organization import *
from Project import *
from PullRequest import *
from PullRequestComment import *
from PullRequestReview import *
from PullRequestFile import *
from RateLimiting import *
from Repository import *
from RepositoryKey import *
from RequiredPullRequestReviews import *
from RequiredStatusChecks import *
from SourceImport import *
from Status import *
from Tag import *
from Team import *
from UserKey import *
from PaginatedList import *
from Exceptions import *
from Enterprise import *
from Logging_ import *
from RawData import *
from ConditionalRequestUpdate import *
from Persistence import *
from ExposeAllAttributes import *
from BadAttributes import *
from Equality import *
from Search import *
from Issue33 import *
from Issue50 import *
from Issue54 import *
from Issue80 import *
from Issue87 import *
from Issue131 import *
from Issue133 import *
from Issue134 import *
from Issue139 import *
from Issue140 import *
from Issue142 import *
from Issue158 import *
from Issue174 import *
from Issue214 import *
from Issue216 import *
from Issue278 import *
from Issue494 import *
from Issue572 import *