-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #100 from faunadb/new_session_client
adds new_session_client method
- Loading branch information
Showing
6 changed files
with
100 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
from faunadb.objects import Ref | ||
from faunadb.query import create | ||
from faunadb.client import FaunaClient | ||
from faunadb.errors import UnexpectedError | ||
from tests.helpers import FaunaTestCase | ||
|
||
class ClientTest(FaunaTestCase): | ||
|
||
def test_ping(self): | ||
self.assertEqual(self.client.ping("all"), "Scope all is OK") | ||
|
||
def _create_class(self): | ||
return self.client.query(create(Ref("classes"), {"name": "my_class"})) | ||
|
||
def _create_instance(self): | ||
return self.client.query(create(Ref("classes/my_class"), {})) | ||
def test_error_on_closed_client(self): | ||
client = FaunaClient(secret="secret") | ||
client.__del__() | ||
self.assertRaisesRegexCompat(UnexpectedError, | ||
"Cannnot create a session client from a closed session", | ||
lambda: client.new_session_client(secret="new_secret")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters