Skip to content

Commit 7128c12

Browse files
committed
chore(cinder-understack): make data valid for tests
Make the data valid for the tests by defining required parameters. Move an import to the top of the file instead of in a function.
1 parent cf072a3 commit 7128c12

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

python/cinder-understack/cinder_understack/tests/test_dynamic_netapp_driver.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
from cinder.tests.unit import test
66
from cinder.tests.unit.volume.drivers.netapp import fakes as na_fakes
7+
from cinder.volume.drivers.netapp.dataontap.nvme_library import NetAppNVMeStorageLibrary
78

89
from cinder_understack import dynamic_netapp_driver
910

@@ -24,7 +25,11 @@ def setUp(self):
2425

2526
def get_config_base(self):
2627
"""Get base configuration for testing."""
27-
return na_fakes.create_configuration()
28+
cfg = na_fakes.create_configuration()
29+
cfg.netapp_login = "fake_user"
30+
cfg.netapp_password = "fake_pass" # noqa: S105
31+
cfg.netapp_server_hostname = "127.0.0.1"
32+
return cfg
2833

2934
def test_driver_has_correct_attributes(self):
3035
"""Test that driver has expected attributes."""
@@ -37,10 +42,6 @@ def test_driver_has_library_instance(self):
3742

3843
def test_library_inherits_from_netapp_library(self):
3944
"""Test that library inherits from NetApp NVMe library."""
40-
from cinder.volume.drivers.netapp.dataontap.nvme_library import (
41-
NetAppNVMeStorageLibrary,
42-
)
43-
4445
self.assertIsInstance(self.library, NetAppNVMeStorageLibrary)
4546

4647
@mock.patch.object(dynamic_netapp_driver.NetappDynamicLibrary, "do_setup")

0 commit comments

Comments
 (0)