Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
envsetup
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor 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
mediaserver
envsetup
Commits
70f7b8b9
Commit
70f7b8b9
authored
6 years ago
by
Nicolas KAROLAK
Browse files
Options
Downloads
Patches
Plain Diff
fix(tests): absolute path append
parent
94ac8ba3
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/test_email.py
+2
-1
2 additions, 1 deletion
tests/test_email.py
tests/test_postgresql.py
+3
-2
3 additions, 2 deletions
tests/test_postgresql.py
with
5 additions
and
3 deletions
tests/test_email.py
+
2
−
1
View file @
70f7b8b9
...
@@ -5,6 +5,7 @@ Criticality: High
...
@@ -5,6 +5,7 @@ Criticality: High
Check that emails can be sent.
Check that emails can be sent.
"""
"""
from
pathlib
import
Path
import
os
import
os
import
subprocess
import
subprocess
import
sys
import
sys
...
@@ -22,7 +23,7 @@ except ImportError:
...
@@ -22,7 +23,7 @@ except ImportError:
if
subprocess
.
call
([
"
which
"
,
"
netstat
"
])
!=
0
:
if
subprocess
.
call
([
"
which
"
,
"
netstat
"
])
!=
0
:
subprocess
.
check_call
([
"
apt-get
"
,
"
-qq
"
,
"
-y
"
,
"
install
"
,
"
net-tools
"
])
subprocess
.
check_call
([
"
apt-get
"
,
"
-qq
"
,
"
-y
"
,
"
install
"
,
"
net-tools
"
])
sys
.
path
.
append
(
"
..
"
)
sys
.
path
.
append
(
str
(
Path
(
__file__
).
parents
[
1
].
resolve
())
)
# pylint: disable=wrong-import-position
# pylint: disable=wrong-import-position
from
envsetup
import
utils
as
u
# noqa: E402
from
envsetup
import
utils
as
u
# noqa: E402
...
...
This diff is collapsed.
Click to expand it.
tests/test_postgresql.py
+
3
−
2
View file @
70f7b8b9
...
@@ -4,6 +4,7 @@ Criticality: High
...
@@ -4,6 +4,7 @@ Criticality: High
This test check the current state of the PostgreSQL database cluster.
This test check the current state of the PostgreSQL database cluster.
"""
"""
from
pathlib
import
Path
import
re
import
re
import
socket
import
socket
import
subprocess
import
subprocess
...
@@ -11,13 +12,13 @@ import sys
...
@@ -11,13 +12,13 @@ import sys
import
time
import
time
import
uuid
import
uuid
sys
.
path
.
append
(
"
..
"
)
try
:
try
:
import
psycopg2
import
psycopg2
except
ImportError
:
except
ImportError
:
sys
.
exit
(
2
)
sys
.
exit
(
2
)
sys
.
path
.
append
(
str
(
Path
(
__file__
).
parents
[
1
].
resolve
()))
# pylint: disable=wrong-import-position
# pylint: disable=wrong-import-position
from
envsetup
import
utils
as
u
# noqa: E402
from
envsetup
import
utils
as
u
# noqa: E402
...
...
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