##############################################################################
# https://docs.python.org/3/library/io.html
-import io
+import os
import tempfile
-from apex.deploy_settings import DeploySettings
-from apex.deploy_settings import DeploySettingsException
-
from nose.tools import assert_equal
-from nose.tools import assert_raises
from nose.tools import assert_is_instance
+from nose.tools import assert_raises
+
+from apex.settings.deploy_settings import DeploySettings
+from apex.settings.deploy_settings import DeploySettingsException
+from apex.tests.constants import TEST_CONFIG_DIR
deploy_files = ('deploy_settings.yaml',
'os-nosdn-nofeature-noha.yaml',
def test_init(self):
for f in deploy_files:
- ds = DeploySettings('../config/deploy/{}'.format(f))
+ ds = DeploySettings(os.path.join(TEST_CONFIG_DIR, 'deploy', f))
ds = DeploySettings(ds)
def test__validate_settings(self):
finally:
f.close()
- def test_dump_bash(self):
- # the performance file has the most use of the function
- # so using that as the test case
- ds = DeploySettings('../config/deploy/os-nosdn-performance-ha.yaml')
- assert_equal(ds.dump_bash(), None)
- assert_equal(ds.dump_bash(path='/dev/null'), None)
-
- def test_exception(sefl):
+ def test_exception(self):
e = DeploySettingsException("test")
print(e)
assert_is_instance(e, DeploySettingsException)