FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
datajoint-python/tests/test_foreign_keys.py at master · colima/datajoint-python · GitHub
colima
datajoint-python
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
datajoint-python
/
tests
/
test_foreign_keys.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
26 lines (20 loc) · 878 Bytes
Breadcrumbs
datajoint-python
/
tests
/
test_foreign_keys.py
Copy path
File metadata and controls
26 lines (20 loc) · 878 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from
nose
.
tools
import
assert_equal
from
datajoint
.
declare
import
declare
from
.
import
schema_advanced
context
=
schema_advanced
.
schema
.
context
def
test_aliased_fk
():
person
=
schema_advanced
.
Person
()
parent
=
schema_advanced
.
Parent
()
person
.
fill
()
parent
.
fill
()
link
=
person
.
proj
(
parent_name
=
'full_name'
,
parent
=
'person_id'
)
parents
=
person
*
parent
*
link
parents
&=
dict
(
full_name
=
"May K. Hall"
)
assert_equal
(
set
(
parents
.
fetch
(
'parent_name'
)), {
'Hanna R. Walters'
,
'Russel S. James'
})
def
test_describe
():
"""real_definition should match original definition"""
for
rel
in
(
schema_advanced
.
LocalSynapse
(),
schema_advanced
.
GlobalSynapse
()):
describe
=
rel
.
describe
()
s1
=
declare
(
rel
.
full_table_name
,
rel
.
definition
,
context
)
s2
=
declare
(
rel
.
full_table_name
,
describe
,
context
)
assert_equal
(
s1
,
s2
)
Back
|
FazBrowse Home
|
New Git URL