projects
/
osm
/
MON.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Adds pylint to tox test pipeline and fixes related errors
[osm/MON.git]
/
osm_mon
/
tests
/
core
/
test_database.py
diff --git
a/osm_mon/tests/core/test_database.py
b/osm_mon/tests/core/test_database.py
index
482e58b
..
3f8eb7e
100644
(file)
--- a/
osm_mon/tests/core/test_database.py
+++ b/
osm_mon/tests/core/test_database.py
@@
-23,12
+23,15
@@
import unittest
from unittest import mock
import unittest
from unittest import mock
+from osm_mon.core.config import Config
+
from osm_mon.core.database import VimCredentials, DatabaseManager
from osm_mon.core.database import VimCredentials, DatabaseManager
-class DatbaseManagerTest(unittest.TestCase):
+class Dat
a
baseManagerTest(unittest.TestCase):
def setUp(self):
super().setUp()
def setUp(self):
super().setUp()
+ self.config = Config()
@mock.patch.object(DatabaseManager, "get_credentials")
def test_get_vim_type(self, get_credentials):
@mock.patch.object(DatabaseManager, "get_credentials")
def test_get_vim_type(self, get_credentials):
@@
-39,8
+42,9
@@
class DatbaseManagerTest(unittest.TestCase):
mock_creds.password = 'password'
mock_creds.tenant_name = 'tenant_name'
mock_creds.type = 'openstack'
mock_creds.password = 'password'
mock_creds.tenant_name = 'tenant_name'
mock_creds.type = 'openstack'
+ mock_creds.config = '{}'
get_credentials.return_value = mock_creds
get_credentials.return_value = mock_creds
- database_manager = DatabaseManager()
+ database_manager = DatabaseManager(
self.config
)
vim_type = database_manager.get_vim_type('test_id')
self.assertEqual(vim_type, 'openstack')
vim_type = database_manager.get_vim_type('test_id')
self.assertEqual(vim_type, 'openstack')