-
-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
347 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,8 @@ def check_python_version(): | |
"psycopg2", | ||
"sqlalchemy", | ||
"pre-commit", | ||
"flupy", | ||
"isort", | ||
] | ||
|
||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
create extension "uuid-ossp"; | ||
|
||
create table account( | ||
id uuid not null default uuid_generate_v4() primary key, | ||
email varchar(255) not null, | ||
encrypted_password varchar(255) not null, | ||
created_at timestamp not null, | ||
updated_at timestamp not null | ||
); |
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 |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import json | ||
|
||
from sqlalchemy import func, select, text | ||
|
||
|
||
def test_get_name(sess): | ||
|
||
selection = json.dumps({ | ||
"kind": "Field", | ||
"name": { | ||
"kind": "Name", | ||
"value": "hello" | ||
}, | ||
"alias": None, | ||
"arguments": None, | ||
"directives": None, | ||
"selectionSet": None | ||
}) | ||
|
||
(result,) = sess.execute(select([func.gql.get_name(selection)])).fetchone() | ||
|
||
assert result == "hello" | ||
|
||
|
||
def test_get_alias(sess): | ||
|
||
selection = json.dumps({ | ||
"kind": "Field", | ||
"name": { | ||
"kind": "Name", | ||
"value": "hello" | ||
}, | ||
"alias": { | ||
"kind": "Name", | ||
"value": "hello_alias" | ||
}, | ||
"arguments": None, | ||
"directives": None, | ||
"selectionSet": None | ||
}) | ||
|
||
(result,) = sess.execute(select([func.gql.get_alias(selection)])).fetchone() | ||
|
||
assert result == "hello_alias" | ||
|
||
|
||
def test_get_alias_defaults_to_name(sess): | ||
|
||
selection = json.dumps({ | ||
"kind": "Field", | ||
"name": { | ||
"kind": "Name", | ||
"value": "hello" | ||
}, | ||
"alias": None, | ||
"arguments": None, | ||
"directives": None, | ||
"selectionSet": None | ||
}) | ||
|
||
(result,) = sess.execute(select([func.gql.get_alias(selection)])).fetchone() | ||
|
||
assert result == "hello" |
Oops, something went wrong.