Skip to content

Commit

Permalink
Back out ClientBase subclassing.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Koss committed Nov 8, 2016
1 parent f492212 commit ca014d7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 19 deletions.
15 changes: 5 additions & 10 deletions firestore/google/cloud/firestore/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,13 @@

"""Firestore database API."""

from google.cloud.client import Client as _BaseClient
from google.cloud.client import _ClientProjectMixin


class Client(_BaseClient, _ClientProjectMixin):
class Client(object):
"""Top level Firestore database instance.
:type project_id: str
:param project_id: (optional) Project containing the Firestore database.
:type project: str
:param project: (optional) Project containing the Firestore database.
"""

def __init__(self, project_id=None):
_ClientProjectMixin.__init__(self, project=project_id)
super(Client, self).__init__()
self.database_id = None
def __init__(self, project=None):
raise NotImplementedError()
12 changes: 3 additions & 9 deletions firestore/unit_tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,12 @@

import unittest

from six import string_types

from google.cloud.firestore import Client


class TestFirestore(unittest.TestCase):
"""Unit Tests for the google.cloud.firestore.Firestore."""

def test_empty_constructor(self):
db = Client()
self.assertIsInstance(db.project, string_types)
"""Unit Tests for the google.cloud.firestore.Client."""

def test_constructor(self):
db = Client('my-project-id')
self.assertEqual(db.project, 'my-project-id')
with self.assertRaises(NotImplementedError):
Client('my-project-id')

0 comments on commit ca014d7

Please sign in to comment.