Skip to content
This repository was archived by the owner on Dec 17, 2019. It is now read-only.

Commit 567e89c

Browse files
committed
Merge 'master'
1 parent caa25dc commit 567e89c

File tree

6 files changed

+32
-7
lines changed

6 files changed

+32
-7
lines changed

.travis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
language: python
2+
python:
3+
- "2.6"
4+
- "2.7"
5+
install:
6+
- pip install -r requirements/dev.txt --use-mirrors
7+
script: nosetests

README.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. image:: https://secure.travis-ci.org/copitux/python-github3.png
2+
13
Pygithub3
24
==========
35

@@ -45,11 +47,11 @@ Achievements
4547
- `Pull requests service <http://developer.github.com/v3/pulls/>`_
4648
- `Orgs service <http://developer.github.com/v3/orgs/>`_
4749
- `Issues service <http://developer.github.com/v3/issues/>`_
50+
- `Events service <http://developer.github.com/v3/events/>`_
4851

4952
TODO
5053
-----
5154

52-
- Services: Events
5355
- Oauth authorization API (service?)
5456
- Proxy methods into resources (e.g copitux.followers)
5557

pygithub3/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
#!/usr/bin/env python
21
# -*- encoding: utf-8 -*-
32

43
__title__ = 'pygithub3'
5-
__version__ = '0.4.1'
4+
__version__ = '0.5'
65
__author__ = 'David Medina'
76
__email__ = 'davidmedina9@gmail.com'
87
__license__ = 'ISC'

pygithub3/github.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def __init__(self, **config):
1717
from pygithub3.services.users import User
1818
from pygithub3.services.repos import Repo
1919
from pygithub3.services.gists import Gist
20-
from pygithub3.services.events import Events
20+
from pygithub3.services.events import Event
2121
from pygithub3.services.git_data import GitData
2222
from pygithub3.services.pull_requests import PullRequests
2323
from pygithub3.services.orgs import Org
@@ -29,7 +29,7 @@ def __init__(self, **config):
2929
self._pull_requests = PullRequests(**config)
3030
self._orgs = Org(**config)
3131
self._issues = Issue(**config)
32-
self._events = Events(**config)
32+
self._events = Event(**config)
3333

3434
@property
3535
def remaining_requests(self):

pygithub3/services/pull_requests/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ def __init__(self, **config):
1111
self.comments = Comments(**config)
1212
super(PullRequests, self).__init__(**config)
1313

14-
def list(self, user=None, repo=None):
14+
def list(self, state='open', user=None, repo=None):
1515
"""List all of the pull requests for a repo
1616
17+
:param str state: Pull requests state ('open' or 'closed')
1718
:param str user: Username
1819
:param str repo: Repository
1920
:returns: A :doc:`result`
@@ -22,7 +23,8 @@ def list(self, user=None, repo=None):
2223
Remember :ref:`config precedence`
2324
"""
2425
return self._get_result(
25-
self.make_request('pull_requests.list', user=user, repo=repo)
26+
self.make_request('pull_requests.list', user=user, repo=repo),
27+
state=state
2628
)
2729

2830
def get(self, number, user=None, repo=None):

pygithub3/tests/core/test_client.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
from pygithub3.core.client import Client
88
from pygithub3.exceptions import NotFound, BadRequest, UnprocessableEntity
9+
from pygithub3.github import Github
910
from pygithub3.tests.utils.base import mock_response
1011
from pygithub3.tests.utils.core import TestCase
1112

@@ -99,3 +100,17 @@ def test_raise_UnprocessableEntity(self, request_method):
99100
request_method.return_value.status_code = 422
100101
request_method.return_value.content = {}
101102
self.assertRaises(UnprocessableEntity, *self.callback)
103+
104+
class TestGithubGlue(TestCase):
105+
106+
def test_init(self):
107+
gh = Github(login='dummy', password='dummy', user='dummy',
108+
repo='dummy')
109+
self.assertTrue(getattr(gh, '_users', False))
110+
self.assertTrue(getattr(gh, '_repos', False))
111+
self.assertTrue(getattr(gh, '_gists', False))
112+
self.assertTrue(getattr(gh, '_git_data', False))
113+
self.assertTrue(getattr(gh, '_pull_requests', False))
114+
self.assertTrue(getattr(gh, '_orgs', False))
115+
self.assertTrue(getattr(gh, '_issues', False))
116+
self.assertTrue(getattr(gh, '_events', False))

0 commit comments

Comments
 (0)