Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
api
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cubicweb
cubes
api
Commits
b89fbb57896e
Commit
b89fbb57896e
authored
1 year ago
by
Arnaud Vergnet
Browse files
Options
Downloads
Patches
Plain Diff
test: move base_url init in base class
parent
431056164960
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!62
tests: improve coverage
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/test_api_rql.py
+1
-6
1 addition, 6 deletions
test/test_api_rql.py
test/util.py
+5
-0
5 additions, 0 deletions
test/util.py
with
6 additions
and
6 deletions
test/test_api_rql.py
+
1
−
6
View file @
b89fbb57
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
import
json
import
json
import
webtest
import
webtest
from
test.util
import
ApiBaseTC
,
BASE_URL
from
test.util
import
ApiBaseTC
from
cubicweb
import
Binary
from
cubicweb
import
Binary
...
@@ -28,11 +28,6 @@
...
@@ -28,11 +28,6 @@
def
get_body
(
self
,
queries
:
list
):
def
get_body
(
self
,
queries
:
list
):
return
json
.
dumps
(
queries
)
return
json
.
dumps
(
queries
)
@classmethod
def
init_config
(
cls
,
config
):
super
().
init_config
(
config
)
config
.
global_set_option
(
"
base-url
"
,
BASE_URL
)
def
make_rql_request
(
self
,
queries
:
list
[
object
],
status
:
int
=
200
):
def
make_rql_request
(
self
,
queries
:
list
[
object
],
status
:
int
=
200
):
return
self
.
webapp
.
post
(
return
self
.
webapp
.
post
(
self
.
get_api_path
(
"
rql
"
),
self
.
get_api_path
(
"
rql
"
),
...
...
This diff is collapsed.
Click to expand it.
test/util.py
+
5
−
0
View file @
b89fbb57
...
@@ -17,6 +17,11 @@
...
@@ -17,6 +17,11 @@
custom_headers
=
{
"
X-Client-Name
"
:
"
Pytest
"
}
custom_headers
=
{
"
X-Client-Name
"
:
"
Pytest
"
}
@classmethod
@classmethod
def
init_config
(
cls
,
config
):
super
().
init_config
(
config
)
config
.
global_set_option
(
"
base-url
"
,
BASE_URL
)
@classmethod
def
get_api_path
(
cls
,
endpoint
:
str
):
def
get_api_path
(
cls
,
endpoint
:
str
):
return
f
"
{
BASE_URL
[
:
-
1
]
}{
API_PATH_DEFAULT_PREFIX
}
/v1/
{
endpoint
}
"
return
f
"
{
BASE_URL
[
:
-
1
]
}{
API_PATH_DEFAULT_PREFIX
}
/v1/
{
endpoint
}
"
...
...
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