Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Briar GTK
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
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
briar
Briar GTK
Commits
3130797a
Commit
3130797a
authored
6 years ago
by
Nico
Browse files
Options
Downloads
Patches
Plain Diff
Unit tests for API constants
parent
4fd92433
No related branches found
No related tags found
No related merge requests found
Pipeline
#3543
passed
6 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/briar/api/test_constants.py
+31
-0
31 additions, 0 deletions
tests/briar/api/test_constants.py
with
31 additions
and
0 deletions
tests/briar/api/test_constants.py
0 → 100644
+
31
−
0
View file @
3130797a
# Copyright (c) 2019 Nico Alt
# SPDX-License-Identifier: AGPL-3.0-only
# License-Filename: LICENSE.md
from
os.path
import
join
from
pathlib
import
Path
from
unittest
import
TestCase
from
briar.api.constants
import
BASE_HTTP_URL
,
BRIAR_AUTH_TOKEN
from
briar.api.constants
import
BRIAR_DB
,
WEBSOCKET_URL
class
TestConstants
(
TestCase
):
def
test_base_http_url
(
self
):
assert
BASE_HTTP_URL
==
"
http://localhost:7000/v1/
"
def
test_briar_auth_token
(
self
):
briar_dir
=
TestConstants
.
_get_briar_dir
()
assert
BRIAR_AUTH_TOKEN
==
join
(
briar_dir
,
"
auth_token
"
)
def
test_briar_db
(
self
):
briar_dir
=
TestConstants
.
_get_briar_dir
()
assert
BRIAR_DB
==
join
(
briar_dir
,
"
db
"
,
"
db.mv.db
"
)
def
test_websocket_url
(
self
):
assert
WEBSOCKET_URL
==
"
ws://localhost:7000/v1/ws
"
# TODO: Use pytest fixtures
def
_get_briar_dir
():
return
join
(
str
(
Path
.
home
()),
"
.briar
"
)
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