Skip to content

Commit

Permalink
Consistency: use 'project' everywhere, rather than 'project_id'.
Browse files Browse the repository at this point in the history
  • Loading branch information
tseaver committed Apr 29, 2015
1 parent 3cbfe2f commit bede80f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions docs/pubsub-usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Connection / Authorization

- credentials (derived from GAE / GCE environ if present).

- ``project_id`` (derived from GAE / GCE environ if present).
- ``project`` (derived from GAE / GCE environ if present).

- ``scopes``

Expand All @@ -29,7 +29,7 @@ Create a new topic for an explicit project:
.. doctest::

>>> from gcloud.pubsub import Topic
>>> topic = Topic('topic_name', project_id='my.project')
>>> topic = Topic('topic_name', project='my.project')
>>> topic.create() # API request

Check for the existance of a topic:
Expand All @@ -54,7 +54,7 @@ List topics for an explicit project:
.. doctest::

>>> from gcloud.pubsub import list_topics
>>> topics = list_topics(project_id='my.project') # API request
>>> topics = list_topics(project='my.project') # API request
>>> [topic.name for topic in topics]
['topic_name']

Expand Down
6 changes: 3 additions & 3 deletions gcloud/test__helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,13 +340,13 @@ def close(self):

class _HTTPConnection(_BaseHTTPConnection):

def __init__(self, status, project_id):
def __init__(self, status, project):
super(_HTTPConnection, self).__init__()
self.status = status
self.project_id = project_id
self.project = project

def getresponse(self):
return _HTTPResponse(self.status, self.project_id)
return _HTTPResponse(self.status, self.project)


class _TimeoutHTTPConnection(_BaseHTTPConnection):
Expand Down
4 changes: 2 additions & 2 deletions regression/pubsub.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ def test_list_topics(self):

# Retrieve the topics.
all_topics, _ = pubsub.list_topics()
project_id = pubsub.get_default_project()
project = pubsub.get_default_project()
created = [topic for topic in all_topics
if topic.name in topics_to_create and
topic.project == project_id]
topic.project == project]
self.assertEqual(len(created), len(topics_to_create))

def test_create_subscription(self):
Expand Down

0 comments on commit bede80f

Please sign in to comment.