Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
DBRepo
Manage
Activity
Members
Labels
Plan
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FAIR Data Austria DB Repository
DBRepo
Commits
52b0e1f6
Verified
Commit
52b0e1f6
authored
11 months ago
by
Martin Weise
Browse files
Options
Downloads
Patches
Plain Diff
Fixed tests
parent
9b514abd
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!277
Dev
,
!275
Dev
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/python/tests/test_unit_table.py
+22
-4
22 additions, 4 deletions
lib/python/tests/test_unit_table.py
lib/python/tests/test_unit_view.py
+7
-1
7 additions, 1 deletion
lib/python/tests/test_unit_view.py
with
29 additions
and
5 deletions
lib/python/tests/test_unit_table.py
+
22
−
4
View file @
52b0e1f6
...
@@ -8,7 +8,7 @@ from dbrepo.RestClient import RestClient
...
@@ -8,7 +8,7 @@ from dbrepo.RestClient import RestClient
from
pandas
import
DataFrame
from
pandas
import
DataFrame
from
dbrepo.api.dto
import
Table
,
CreateTableConstraints
,
UserAttributes
,
User
,
Column
,
Constraints
,
ColumnType
,
Result
,
\
from
dbrepo.api.dto
import
Table
,
CreateTableConstraints
,
UserAttributes
,
User
,
Column
,
Constraints
,
ColumnType
,
Result
,
\
Concept
,
Unit
,
TableStatistics
,
ColumnStatistic
Concept
,
Unit
,
TableStatistics
,
ColumnStatistic
,
PrimaryKey
,
TableMinimal
,
ColumnMinimal
from
dbrepo.api.exceptions
import
MalformedError
,
ForbiddenError
,
NotExistsError
,
NameExistsError
,
QueryStoreError
,
\
from
dbrepo.api.exceptions
import
MalformedError
,
ForbiddenError
,
NotExistsError
,
NameExistsError
,
QueryStoreError
,
\
AuthenticationError
AuthenticationError
...
@@ -31,7 +31,13 @@ class TableUnitTest(unittest.TestCase):
...
@@ -31,7 +31,13 @@ class TableUnitTest(unittest.TestCase):
queue_name
=
'
test
'
,
queue_name
=
'
test
'
,
routing_key
=
'
dbrepo.test_database_1234.test
'
,
routing_key
=
'
dbrepo.test_database_1234.test
'
,
is_public
=
True
,
is_public
=
True
,
constraints
=
Constraints
(
primary_key
=
[
"
ID
"
],
uniques
=
[],
foreign_keys
=
[],
checks
=
[]),
constraints
=
Constraints
(
uniques
=
[],
foreign_keys
=
[],
checks
=
[],
primary_key
=
[
PrimaryKey
(
id
=
1
,
table
=
TableMinimal
(
id
=
2
,
database_id
=
1
),
column
=
ColumnMinimal
(
id
=
1
,
table_id
=
2
,
database_id
=
1
))]),
columns
=
[
Column
(
id
=
1
,
columns
=
[
Column
(
id
=
1
,
name
=
"
ID
"
,
name
=
"
ID
"
,
database_id
=
1
,
database_id
=
1
,
...
@@ -135,7 +141,13 @@ class TableUnitTest(unittest.TestCase):
...
@@ -135,7 +141,13 @@ class TableUnitTest(unittest.TestCase):
queue_name
=
'
test
'
,
queue_name
=
'
test
'
,
routing_key
=
'
dbrepo.test_database_1234.test
'
,
routing_key
=
'
dbrepo.test_database_1234.test
'
,
is_public
=
True
,
is_public
=
True
,
constraints
=
Constraints
(
primary_key
=
[
"
ID
"
],
uniques
=
[],
foreign_keys
=
[],
checks
=
[]),
constraints
=
Constraints
(
uniques
=
[],
foreign_keys
=
[],
checks
=
[],
primary_key
=
[
PrimaryKey
(
id
=
1
,
table
=
TableMinimal
(
id
=
2
,
database_id
=
1
),
column
=
ColumnMinimal
(
id
=
1
,
table_id
=
2
,
database_id
=
1
))]),
columns
=
[
Column
(
id
=
1
,
columns
=
[
Column
(
id
=
1
,
name
=
"
ID
"
,
name
=
"
ID
"
,
database_id
=
1
,
database_id
=
1
,
...
@@ -169,7 +181,13 @@ class TableUnitTest(unittest.TestCase):
...
@@ -169,7 +181,13 @@ class TableUnitTest(unittest.TestCase):
queue_name
=
'
test
'
,
queue_name
=
'
test
'
,
routing_key
=
'
dbrepo.test_database_1234.test
'
,
routing_key
=
'
dbrepo.test_database_1234.test
'
,
is_public
=
True
,
is_public
=
True
,
constraints
=
Constraints
(
primary_key
=
[
"
ID
"
],
uniques
=
[],
foreign_keys
=
[],
checks
=
[]),
constraints
=
Constraints
(
uniques
=
[],
foreign_keys
=
[],
checks
=
[],
primary_key
=
[
PrimaryKey
(
id
=
1
,
table
=
TableMinimal
(
id
=
2
,
database_id
=
1
),
column
=
ColumnMinimal
(
id
=
1
,
table_id
=
2
,
database_id
=
1
))]),
columns
=
[
Column
(
id
=
1
,
columns
=
[
Column
(
id
=
1
,
name
=
"
ID
"
,
name
=
"
ID
"
,
database_id
=
1
,
database_id
=
1
,
...
...
This diff is collapsed.
Click to expand it.
lib/python/tests/test_unit_view.py
+
7
−
1
View file @
52b0e1f6
...
@@ -7,7 +7,7 @@ import datetime
...
@@ -7,7 +7,7 @@ import datetime
from
dbrepo.RestClient
import
RestClient
from
dbrepo.RestClient
import
RestClient
from
pandas
import
DataFrame
from
pandas
import
DataFrame
from
dbrepo.api.dto
import
UserAttributes
,
User
,
View
,
Result
from
dbrepo.api.dto
import
UserAttributes
,
User
,
View
,
Result
,
ViewColumn
,
ColumnType
from
dbrepo.api.exceptions
import
ForbiddenError
,
NotExistsError
,
MalformedError
,
AuthenticationError
from
dbrepo.api.exceptions
import
ForbiddenError
,
NotExistsError
,
MalformedError
,
AuthenticationError
...
@@ -33,6 +33,8 @@ class ViewUnitTest(unittest.TestCase):
...
@@ -33,6 +33,8 @@ class ViewUnitTest(unittest.TestCase):
creator
=
User
(
id
=
'
8638c043-5145-4be8-a3e4-4b79991b0a16
'
,
username
=
'
mweise
'
,
creator
=
User
(
id
=
'
8638c043-5145-4be8-a3e4-4b79991b0a16
'
,
username
=
'
mweise
'
,
attributes
=
UserAttributes
(
theme
=
'
light
'
)),
attributes
=
UserAttributes
(
theme
=
'
light
'
)),
is_public
=
True
,
is_public
=
True
,
columns
=
[
ViewColumn
(
id
=
1
,
name
=
"
id
"
,
internal_name
=
"
id
"
,
database_id
=
1
,
auto_generated
=
False
,
column_type
=
ColumnType
.
BIGINT
,
is_public
=
True
,
is_null_allowed
=
False
)],
created
=
datetime
.
datetime
(
2024
,
1
,
1
,
0
,
0
,
0
,
0
,
datetime
.
timezone
.
utc
),
created
=
datetime
.
datetime
(
2024
,
1
,
1
,
0
,
0
,
0
,
0
,
datetime
.
timezone
.
utc
),
last_modified
=
datetime
.
datetime
(
2024
,
1
,
1
,
0
,
0
,
0
,
0
,
datetime
.
timezone
.
utc
),
last_modified
=
datetime
.
datetime
(
2024
,
1
,
1
,
0
,
0
,
0
,
0
,
datetime
.
timezone
.
utc
),
identifiers
=
[])]
identifiers
=
[])]
...
@@ -74,6 +76,8 @@ class ViewUnitTest(unittest.TestCase):
...
@@ -74,6 +76,8 @@ class ViewUnitTest(unittest.TestCase):
creator
=
User
(
id
=
'
8638c043-5145-4be8-a3e4-4b79991b0a16
'
,
username
=
'
mweise
'
,
creator
=
User
(
id
=
'
8638c043-5145-4be8-a3e4-4b79991b0a16
'
,
username
=
'
mweise
'
,
attributes
=
UserAttributes
(
theme
=
'
light
'
)),
attributes
=
UserAttributes
(
theme
=
'
light
'
)),
is_public
=
True
,
is_public
=
True
,
columns
=
[
ViewColumn
(
id
=
1
,
name
=
"
id
"
,
internal_name
=
"
id
"
,
database_id
=
1
,
auto_generated
=
False
,
column_type
=
ColumnType
.
BIGINT
,
is_public
=
True
,
is_null_allowed
=
False
)],
created
=
datetime
.
datetime
(
2024
,
1
,
1
,
0
,
0
,
0
,
0
,
datetime
.
timezone
.
utc
),
created
=
datetime
.
datetime
(
2024
,
1
,
1
,
0
,
0
,
0
,
0
,
datetime
.
timezone
.
utc
),
last_modified
=
datetime
.
datetime
(
2024
,
1
,
1
,
0
,
0
,
0
,
0
,
datetime
.
timezone
.
utc
),
last_modified
=
datetime
.
datetime
(
2024
,
1
,
1
,
0
,
0
,
0
,
0
,
datetime
.
timezone
.
utc
),
identifiers
=
[])
identifiers
=
[])
...
@@ -115,6 +119,8 @@ class ViewUnitTest(unittest.TestCase):
...
@@ -115,6 +119,8 @@ class ViewUnitTest(unittest.TestCase):
creator
=
User
(
id
=
'
8638c043-5145-4be8-a3e4-4b79991b0a16
'
,
username
=
'
mweise
'
,
creator
=
User
(
id
=
'
8638c043-5145-4be8-a3e4-4b79991b0a16
'
,
username
=
'
mweise
'
,
attributes
=
UserAttributes
(
theme
=
'
light
'
)),
attributes
=
UserAttributes
(
theme
=
'
light
'
)),
is_public
=
True
,
is_public
=
True
,
columns
=
[
ViewColumn
(
id
=
1
,
name
=
"
id
"
,
internal_name
=
"
id
"
,
database_id
=
1
,
auto_generated
=
False
,
column_type
=
ColumnType
.
BIGINT
,
is_public
=
True
,
is_null_allowed
=
False
)],
created
=
datetime
.
datetime
(
2024
,
1
,
1
,
0
,
0
,
0
,
0
,
datetime
.
timezone
.
utc
),
created
=
datetime
.
datetime
(
2024
,
1
,
1
,
0
,
0
,
0
,
0
,
datetime
.
timezone
.
utc
),
last_modified
=
datetime
.
datetime
(
2024
,
1
,
1
,
0
,
0
,
0
,
0
,
datetime
.
timezone
.
utc
),
last_modified
=
datetime
.
datetime
(
2024
,
1
,
1
,
0
,
0
,
0
,
0
,
datetime
.
timezone
.
utc
),
identifiers
=
[])
identifiers
=
[])
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment