Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
managementhost
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
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
DeployIT
managementhost
Commits
4aa548d9
Commit
4aa548d9
authored
10 years ago
by
Rafael Ostertag
Browse files
Options
Downloads
Patches
Plain Diff
Adopted to changes in deployit.config.
parent
4b830561
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
test/database.py
+8
-6
8 additions, 6 deletions
test/database.py
test/restmodules.py
+1
-1
1 addition, 1 deletion
test/restmodules.py
test/restserver.py
+1
-1
1 addition, 1 deletion
test/restserver.py
with
10 additions
and
8 deletions
test/database.py
+
8
−
6
View file @
4aa548d9
...
...
@@ -3,6 +3,7 @@ import deployit.config
import
os
import
uuid
import
unittest
import
logging
managementhost_log_fixtures
=
[
[
'
1234-a
'
,
'
19700101T00:00:00+00:00
'
,
'
localhost
'
,
'
module1
'
,
1
,
'
nopath
'
,
'
POST
'
,
'
{
"
msg
"
: Null }
'
],
...
...
@@ -23,7 +24,7 @@ class TestDatabase(unittest.TestCase):
def
setUp
(
self
):
try
:
os
.
remove
(
deployit
.
config
.
database
_config
(
'
path
'
)
)
os
.
remove
(
deployit
.
config
.
database
[
'
path
'
]
)
except
:
pass
...
...
@@ -33,11 +34,11 @@ class TestDatabase(unittest.TestCase):
def
test_db_initialization
(
self
):
"""
Test the initialization of the Database
"""
db
=
managementhost
.
Database
(
deployit
.
config
.
database_config
(
'
path
'
)
)
db
=
managementhost
.
Database
()
def
test_add_log
(
self
):
"""
Test add log
"""
db
=
managementhost
.
Database
(
deployit
.
config
.
database_config
(
'
path
'
)
)
db
=
managementhost
.
Database
()
[
db
.
add_log
(
*
arg
)
for
arg
in
managementhost_log_fixtures
]
def
test_add_invalid_log
(
self
):
...
...
@@ -49,20 +50,20 @@ class TestDatabase(unittest.TestCase):
transaction.
"""
db
=
managementhost
.
Database
(
deployit
.
config
.
database_config
(
'
path
'
)
)
db
=
managementhost
.
Database
()
with
self
.
assertRaises
(
Exception
):
[
db
.
add_log
(
*
arg
)
for
arg
in
managementhost_log_invalid_fixtures
]
self
.
assertIsNone
(
db
.
_get_host_module
(
'
module2
'
,
2
))
def
test_log_retrieval
(
self
):
db
=
managementhost
.
Database
(
deployit
.
config
.
database_config
(
'
path
'
)
)
db
=
managementhost
.
Database
()
[
db
.
add_log
(
*
arg
)
for
arg
in
managementhost_log_fixtures
]
for
fixture
in
managementhost_log_fixtures
:
db
.
get_log
(
fixture
[
0
])
==
fixture
def
test_get_module_logs
(
self
):
db
=
managementhost
.
Database
(
deployit
.
config
.
database_config
(
'
path
'
)
)
db
=
managementhost
.
Database
()
[
db
.
add_log
(
*
arg
)
for
arg
in
managementhost_log_fixtures
]
logs
=
db
.
get_module_logs
(
'
module2
'
,
5
)
...
...
@@ -70,4 +71,5 @@ class TestDatabase(unittest.TestCase):
if
__name__
==
'
__main__
'
:
logging
.
basicConfig
(
log_level
=
logging
.
DEBUG
)
unittest
.
main
()
This diff is collapsed.
Click to expand it.
test/restmodules.py
+
1
−
1
View file @
4aa548d9
...
...
@@ -11,7 +11,7 @@ class TestRestModules(unittest.TestCase):
@classmethod
def
setUpClass
(
cls
):
deployit
.
config
.
read
(
'
testconfig.cfg
'
)
deployit
.
modules
.
init_modules
(
deployit
.
config
.
modules
_config
(
'
path
'
)
)
deployit
.
modules
.
init_modules
(
deployit
.
config
.
modules
[
'
path
'
]
)
def
test_existence
(
self
):
self
.
assertIn
(
'
Dummy
'
,
deployit
.
modules
.
modulelist
)
...
...
This diff is collapsed.
Click to expand it.
test/restserver.py
+
1
−
1
View file @
4aa548d9
...
...
@@ -26,7 +26,7 @@ if __name__ == "__main__":
args
=
parser
.
parse_args
()
deployit
.
config
.
read
(
args
.
cfgfile
)
deployit
.
modules
.
init_modules
(
deployit
.
config
.
modules
_config
(
'
path
'
)
)
deployit
.
modules
.
init_modules
(
deployit
.
config
.
modules
[
'
path
'
]
)
# Remove command line argument, because they would be consumed by
# app.run() as well. By doing so, we can't make the server
...
...
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