Migrates Apex to Python
[apex.git] / apex / tests / test_apex_deploy_settings.py
similarity index 83%
rename from tests/test_apex_deploy_settings.py
rename to apex/tests/test_apex_deploy_settings.py
index 00eb274..312c1f3 100644 (file)
@@ -8,15 +8,16 @@
 ##############################################################################
 
 # 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',
@@ -80,7 +81,7 @@ class TestIpUtils(object):
 
     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):
@@ -94,14 +95,7 @@ class TestIpUtils(object):
             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)