]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Get rid of nose.main() in unit test files
authorZane Bitter <zbitter@redhat.com>
Thu, 13 Dec 2012 14:57:59 +0000 (15:57 +0100)
committerZane Bitter <zbitter@redhat.com>
Thu, 13 Dec 2012 14:58:16 +0000 (15:58 +0100)
This doesn't actually work and is not universally present, so get rid of
it. Tests are run through "nosetests", which does actually work.

Change-Id: Ib2d1e857e0aef4eab5fd75ffb1a498d8e9186c01
Signed-off-by: Zane Bitter <zbitter@redhat.com>
41 files changed:
heat/tests/functional/test_AutoScalingMultiAZSample.py
heat/tests/functional/test_CFN_API_UpdateStack.py
heat/tests/functional/test_HAProxy_Single_Instance.py
heat/tests/functional/test_OpenShift_Prebuilt_JEOS.py
heat/tests/functional/test_WordPress_2_Instances_With_EBS_EIP.py
heat/tests/functional/test_WordPress_Composed_Instances.py
heat/tests/functional/test_WordPress_Single_Instance.py
heat/tests/functional/test_WordPress_Single_Instance_Boto.py
heat/tests/functional/test_WordPress_Single_Instance_With_HA.py
heat/tests/functional/test_WordPress_Single_Instance_With_IHA.py
heat/tests/functional/test_WordPress_With_LB.py
heat/tests/functional/test_WordPress_With_RDS.py
heat/tests/functional/util.py
heat/tests/test_api_aws.py
heat/tests/test_api_cfn_v1.py
heat/tests/test_api_cloudwatch.py
heat/tests/test_api_openstack_v1.py
heat/tests/test_autoscaling.py
heat/tests/test_dbinstance.py
heat/tests/test_dependencies.py
heat/tests/test_eip.py
heat/tests/test_engine_api_utils.py
heat/tests/test_engine_service.py
heat/tests/test_identifier.py
heat/tests/test_instance.py
heat/tests/test_loadbalancer.py
heat/tests/test_parameters.py
heat/tests/test_parser.py
heat/tests/test_plugin_loader.py
heat/tests/test_properties.py
heat/tests/test_quantum.py
heat/tests/test_resource.py
heat/tests/test_s3.py
heat/tests/test_template_format.py
heat/tests/test_urlfetch.py
heat/tests/test_user.py
heat/tests/test_validate.py
heat/tests/test_volume.py
heat/tests/test_vpc.py
heat/tests/test_waitcondition.py
heat/tests/test_watch.py

index 397967f9e54b1ebe8a0d0f4d077a7d2b464f83d8..151a1cf57dfd0e39bc40160b05a88b21614dc5e9 100644 (file)
@@ -14,7 +14,6 @@
 
 import util
 import verify
-import nose
 from nose.plugins.attrib import attr
 import unittest
 import os
index feae070457ce469f82c517cd01f601684a6be1e6..d540de4f5ec385b0a4c6d13544e55a2a626d4479 100644 (file)
@@ -16,7 +16,6 @@ import os
 import util
 import verify
 import re
-import nose
 from nose.plugins.attrib import attr
 import unittest
 import json
index 6dd2ab3523bbc5b4fc6b9181f4afe73b1d35995f..0d8fe3d930cd19f2099d262ee5e349f24f2f94e7 100644 (file)
@@ -14,7 +14,6 @@
 
 import util
 import verify
-import nose
 from nose.plugins.attrib import attr
 import unittest
 import os
index 58d8af6aad8a7ffea30a775a05ed3c29fbe82084..e97aad3186eeeff93be8e307107170e6006bdbd8 100644 (file)
@@ -14,7 +14,6 @@
 
 import util
 import verify
-import nose
 from nose.plugins.attrib import attr
 import unittest
 import os
index 29ed0fba09f776802e37ccd2e39f75f11776e375..45a6f04a11b78977e379f0d2e79019f1ec7cfca1 100644 (file)
@@ -14,7 +14,6 @@
 
 import util
 import verify
-import nose
 from nose.plugins.attrib import attr
 import unittest
 import os
index 606649bd89518df0292c5b87f1d89800c5b8db9d..3b788ac215722977b20593f6f2290d0f42420f42 100644 (file)
@@ -14,7 +14,6 @@
 
 import util
 import verify
-import nose
 from nose.plugins.attrib import attr
 import unittest
 import os
index 375a57cddd6f3c377e1f4dea7d9645cd77fbfc08..d8d003f49cb0c68049c56c86ef74be07b4794da9 100644 (file)
@@ -14,7 +14,6 @@
 
 import util
 import verify
-import nose
 from nose.plugins.attrib import attr
 import unittest
 import os
index f0350c8a9d756cb7235835ed61e8cb7354276831..cac33c076f05f15fe81ba53f5c8d731203d2a44c 100644 (file)
@@ -14,7 +14,6 @@
 
 import util
 import verify
-import nose
 from nose.plugins.attrib import attr
 import unittest
 import os
index 6693e71716154a43783b0036983935021a5b722f..81087dc4b0b6d68fae3e3f45ba793568dbf63d49 100644 (file)
@@ -13,7 +13,6 @@
 #
 
 import util
-import nose
 from nose.plugins.attrib import attr
 import unittest
 import os
index 24e74b0959b77df9d2d0876447f1c5c2b697cb52..61c5a796d376e84f955e8acd3f121f4baeb754ad 100644 (file)
@@ -15,7 +15,6 @@
 import os
 import util
 import verify
-import nose
 from nose.plugins.attrib import attr
 import unittest
 import time
index b8f5ec0c3e7648c8225a1c1578712a931582de92..dd41969baa2c866d0e76ea00f192b3f851f1c1f7 100644 (file)
@@ -14,7 +14,6 @@
 
 import util
 import verify
-import nose
 from nose.plugins.attrib import attr
 import unittest
 import os
index d5a2e049ade7f306ea96362bf27e833a7d8a7831..a7d90295d776cba8d1451c08a91cef58b7b6040f 100644 (file)
@@ -15,7 +15,6 @@
 import os
 import util
 import verify
-import nose
 from nose.plugins.attrib import attr
 import unittest
 
index 76eb07f5d40408303ed0c0df19d2e5db29eb7a3a..27d4fd62a876e7a83f7bed21f44fed21ecc444ed 100644 (file)
@@ -13,7 +13,6 @@
 #    under the License.
 
 
-import sys
 import os
 import optparse
 import paramiko
@@ -22,7 +21,6 @@ import hashlib
 import email
 import json
 import time  # for sleep
-import nose
 import errno
 import tempfile
 import stat
@@ -625,8 +623,3 @@ def remove_host(ip, hostname):
             tmp.write(line)
         os.chmod(tmp.name, perms)
         os.rename(tmp.name, '/etc/hosts')
-
-
-if __name__ == '__main__':
-    sys.argv.append(__file__)
-    nose.main()
index bad94f7c5be4a36c04355b69db9abcf9f6358eae..1db4f37f48b2aa78df7b69f63ee1aa5143636976 100644 (file)
@@ -13,9 +13,7 @@
 #    under the License.
 
 
-import sys
 import socket
-import nose
 import json
 import unittest
 from nose.plugins.attrib import attr
@@ -191,8 +189,3 @@ class AWSCommon(unittest.TestCase):
 
     def tearDown(self):
         print "teardown complete"
-
-
-if __name__ == '__main__':
-    sys.argv.append(__file__)
-    nose.main()
index d7b3279ed6021a613a8aa475ce41d7bf3d813b64..f65fe71f576c95e8d0fa46a1954533ea81923fe8 100644 (file)
@@ -13,9 +13,7 @@
 #    under the License.
 
 
-import sys
 import socket
-import nose
 import mox
 import json
 import unittest
@@ -1119,8 +1117,3 @@ class StackControllerTest(unittest.TestCase):
         self.m.UnsetStubs()
         self.m.VerifyAll()
         print "teardown complete"
-
-
-if __name__ == '__main__':
-    sys.argv.append(__file__)
-    nose.main()
index c4d9750a34792d9187e0d4de54410db46fe8e4da..149390cc9fd4a29e98ac56257c831e34b31a20a6 100644 (file)
@@ -13,9 +13,7 @@
 #    under the License.
 
 
-import sys
 import socket
-import nose
 import mox
 import json
 import unittest
@@ -478,8 +476,3 @@ class WatchControllerTest(unittest.TestCase):
         self.m.UnsetStubs()
         self.m.VerifyAll()
         print "teardown complete"
-
-
-if __name__ == '__main__':
-    sys.argv.append(__file__)
-    nose.main()
index 3f3efd5a0af7d12fe4a2ccf12efc53915433b053..c48f8e8b69db6c54bee507c498403ef17063b305 100644 (file)
@@ -13,8 +13,6 @@
 #    under the License.
 
 
-import sys
-import nose
 import mox
 import json
 import unittest
@@ -1439,8 +1437,3 @@ class EventControllerTest(ControllerTest, unittest.TestCase):
                           stack_id=stack_identity.stack_id,
                           resource_name=res_name, event_id=event_id)
         self.m.VerifyAll()
-
-
-if __name__ == '__main__':
-    sys.argv.append(__file__)
-    nose.main()
index 752310d3f8eec93135d5671f9dd5e181167f5dd7..25f37087c4007a79e498b841701e212f166018d3 100644 (file)
 #    under the License.
 
 
-import sys
 import os
 
-import nose
 import unittest
 import mox
 import json
@@ -166,8 +164,3 @@ class AutoScalingTest(unittest.TestCase):
                  resource.resource_id)
 
         resource.delete()
-
-    # allows testing of the test directly, shown below
-    if __name__ == '__main__':
-        sys.argv.append(__file__)
-        nose.main()
index c0dcc2d49ed8a732a038b7a6fe142405de392357..bba5ec39b423a47b319e189f99a3906b2509f584 100644 (file)
 #    under the License.
 
 
-import sys
 import os
 
-import nose
 import unittest
 import mox
 import json
@@ -115,8 +113,3 @@ class DBInstanceTest(unittest.TestCase):
             raise Exception('Expected InvalidTemplateAttribute')
 
         self.m.VerifyAll()
-
-    # allows testing of the test directly, shown below
-    if __name__ == '__main__':
-        sys.argv.append(__file__)
-        nose.main()
index 3bcac0aa2a0d4ef4fc3944c0df80ad2fff3e5aa8..36a19126191e798dddc8760b82d7a66952597908 100644 (file)
@@ -13,7 +13,6 @@
 #    under the License.
 
 
-import nose
 import unittest
 from nose.plugins.attrib import attr
 
@@ -193,9 +192,3 @@ class dependenciesTest(unittest.TestCase):
         for n in ('last', 'mid1', 'mid2', 'mid3'):
             self.assertTrue(n in order,
                             "'%s' not found in dependency order" % n)
-
-
-# allows testing of the test directly, shown below
-if __name__ == '__main__':
-    sys.argv.append(__file__)
-    nose.main()
index 6203f573166d01695b7ff6273ab549f0ca1b8469..4482e61486a026fe211bb9475337c01dd79acbe6 100644 (file)
 #    under the License.
 
 
-import sys
 import os
 
-import nose
 import unittest
 import mox
 import json
@@ -136,8 +134,3 @@ class EIPTest(unittest.TestCase):
         resource.delete()
 
         self.m.VerifyAll()
-
-    # allows testing of the test directly, shown below
-    if __name__ == '__main__':
-        sys.argv.append(__file__)
-        nose.main()
index 8650a6bc395bb22a7e8299d41f545d34bda7e0a4..8e50d212e00cb34481e06c2eba4008749d99c552 100644 (file)
@@ -13,7 +13,6 @@
 #    under the License.
 
 
-import nose
 import unittest
 from nose.plugins.attrib import attr
 
index 135acb4c74f1e9c3eb1a78f2072a3a7d866a8291..8a84854d54e513b675936df8719719a3b5db9252 100644 (file)
 #    under the License.
 
 
-import sys
 import os
 
-import nose
 import unittest
 import mox
 import json
@@ -788,9 +786,3 @@ class stackServiceTest(unittest.TestCase):
         self.assertRaises(AttributeError,
                           self.man.set_watch_state,
                           self.ctx, watch_name="nonexistent", state=state)
-
-
-# allows testing of the test directly
-if __name__ == '__main__':
-    sys.argv.append(__file__)
-    nose.main()
index 30469ba332756b415aa373a23ba6d5e185977081..c1d45dda6ed149bbd8807d28fdfdccc4c06a195f 100644 (file)
@@ -13,7 +13,6 @@
 #    under the License.
 
 
-import nose
 import unittest
 from nose.plugins.attrib import attr
 import mox
@@ -427,9 +426,3 @@ class EventIdentifierTest(unittest.TestCase):
     def test_event_id(self):
         ei = identifier.EventIdentifier('t', 's', 'i', '/resources/p', 'e')
         self.assertEqual(ei.event_id, 'e')
-
-
-# allows testing of the test directly, shown below
-if __name__ == '__main__':
-    sys.argv.append(__file__)
-    nose.main()
index 34a3db1248767180f97956ec913feb86d5c95b24..34fa38b687e6eb35e348345e9c4f1120677e9d17 100644 (file)
 #    under the License.
 
 
-import sys
 import os
 
-import nose
 import unittest
 import mox
 import json
@@ -128,8 +126,3 @@ class instancesTest(unittest.TestCase):
         self.assertTrue(instance.resource_id is None)
         self.assertEqual(instance.state, instance.DELETE_COMPLETE)
         self.m.VerifyAll()
-
-    # allows testing of the test directly, shown below
-    if __name__ == '__main__':
-        sys.argv.append(__file__)
-        nose.main()
index 467fc791eb33079a5b5a5254ebff14096a7450f5..46941b3c923381483db2142438632104ff80c6f1 100644 (file)
 
 
 import re
-import sys
 import os
 
-import nose
 import unittest
 import mox
 import json
@@ -164,8 +162,3 @@ class LoadBalancerTest(unittest.TestCase):
             msg = '%s: %r not found in %r' % (msg,
                                               expected_regexp.pattern, text)
             raise self.failureException(msg)
-
-    # allows testing of the test directly, shown below
-    if __name__ == '__main__':
-        sys.argv.append(__file__)
-        nose.main()
index 0f4a34891fc234eed65b7f6a71134e9cbd25773c..aa41f98a35da36bb4e7f877b8a7b5455ea264ed8 100644 (file)
@@ -13,7 +13,6 @@
 #    under the License.
 
 
-import nose
 import unittest
 from nose.plugins.attrib import attr
 import mox
@@ -323,9 +322,3 @@ class ParametersTest(unittest.TestCase):
                     'AWS::StackName': True}
 
         self.assertEqual(params.map(lambda p: p.has_default()), expected)
-
-
-# allows testing of the test directly, shown below
-if __name__ == '__main__':
-    sys.argv.append(__file__)
-    nose.main()
index c4d68f7573493e2f5edba37f9977b26538201b96..32f0947294fa9a393495d1334f83e6b4cfcfce8e 100644 (file)
 #    under the License.
 
 
-import nose
 import unittest
 from nose.plugins.attrib import attr
 import mox
 import json
-import sys
 
 from heat.common import context
 from heat.common import exception
@@ -354,8 +352,3 @@ class StackTest(unittest.TestCase):
         stack.state_set(stack.CREATE_IN_PROGRESS, 'testing')
         self.assertNotEqual(stack.updated_time, None)
         self.assertNotEqual(stack.updated_time, stored_time)
-
-# allows testing of the test directly, shown below
-if __name__ == '__main__':
-    sys.argv.append(__file__)
-    nose.main()
index ca4feced1adff90c0ccf2508baad9b4e4eafc964..96dd4a305a41ff12f49a077b7f689af80c43d7a7 100644 (file)
@@ -13,7 +13,6 @@
 #    under the License.
 
 
-import nose
 import pkgutil
 import sys
 import unittest
index 99bde479ea45cf7b17ff82d566fb38d21f72051a..8c6970eea16ee8f06f8408bf302acf2e77f6857b 100644 (file)
@@ -339,9 +339,3 @@ class PropertiesValidationTest(unittest.TestCase):
         schema = {'foo': {'Type': 'String'}}
         props = properties.Properties(schema, {'foo': 42})
         self.assertNotEqual(props.validate(), None)
-
-
-# allows testing of the test directly, shown below
-if __name__ == '__main__':
-    sys.argv.append(__file__)
-    nose.main()
index 91c81736e57788d2d757dc4107729a7b142a5f6e..82506faa028d9464b81e24bb9a2120e37b4a0255 100644 (file)
 #    under the License.
 
 
-import sys
 import os
 
-import nose
 import unittest
 import mox
 import json
@@ -166,8 +164,3 @@ class QuantumTest(unittest.TestCase):
 
         resource.delete()
         self.m.VerifyAll()
-
-    # allows testing of the test directly, shown below
-    if __name__ == '__main__':
-        sys.argv.append(__file__)
-        nose.main()
index 68f6023ae81771be96fec2c1b77e262d0e35983d..2720450f6d0f2022125dc3c836f180fdfc5d1020 100644 (file)
@@ -13,7 +13,6 @@
 #    under the License.
 
 
-import nose
 import unittest
 from nose.plugins.attrib import attr
 import mox
@@ -147,8 +146,3 @@ class MetadataTest(unittest.TestCase):
         test_data = {'Test': 'Newly-written data'}
         self.res.metadata = test_data
         self.assertEqual(self.res.metadata, test_data)
-
-# allows testing of the test directly, shown below
-if __name__ == '__main__':
-    sys.argv.append(__file__)
-    nose.main()
index 6577c0cdb79cd86b1549f609be421333fbd84049..0d5ca3031827d709d235cd1b2092d5156fe8da4c 100644 (file)
 #    under the License.
 
 
-import sys
 import os
 import re
 
-import nose
 import unittest
 import mox
 import json
@@ -243,8 +241,3 @@ class s3Test(unittest.TestCase):
             return
 
         raise Exception('delete_container was called despite Retain policy')
-
-    # allows testing of the test directly, shown below
-    if __name__ == '__main__':
-        sys.argv.append(__file__)
-        nose.main()
index aa05daee616edce5f2d9e013567a61c269856a35..ce65735efd7b77734ce6a73f6c7efe7208a12ae6 100644 (file)
@@ -14,7 +14,6 @@
 
 import json
 import mox
-import nose
 from nose.plugins.attrib import attr
 import os
 import re
index a2d39529408343550205e135052bb0fa60f04d00..c0ab8c7cf5e8b5a2708bb14a400d0d257c44d59e 100644 (file)
@@ -14,7 +14,6 @@
 #    under the License.
 
 import mox
-import nose
 from nose.plugins.attrib import attr
 import StringIO
 import unittest
index f76e2d0d6f91c236d11f5f8fbb6d88fcd391042b..c90f9924dc09ade9056f80f1055d705ddb412eb6 100644 (file)
 #    under the License.
 
 
-import sys
 import os
 
 import eventlet
 import json
-import nose
 import mox
 import unittest
 
@@ -182,8 +180,3 @@ class UserTest(unittest.TestCase):
                          resource.state)
 
         self.m.VerifyAll()
-
-# allows testing of the test directly, shown below
-if __name__ == '__main__':
-    sys.argv.append(__file__)
-    nose.main()
index 280d2c09f817a4c7c5f5aaa801dad526af1f0aa9..2df58d30c7fb6a0d218b48b80ee6e72269933d62 100644 (file)
@@ -11,8 +11,8 @@
 #    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 #    License for the specific language governing permissions and limitations
 #    under the License.
-import sys
-import nose
+
+
 import unittest
 import mox
 import json
@@ -291,8 +291,3 @@ class validateTest(unittest.TestCase):
         res = dict(engine.
             validate_template(None, t))
         self.assertNotEqual(res['Description'], 'Successfully validated')
-
-    # allows testing of the test directly, shown below
-    if __name__ == '__main__':
-        sys.argv.append(__file__)
-        nose.main()
index af38d7387984e9c3f3e2f6cef432e0f4a7b219c0..3fbdbcea3d2cc5dedc3f44324aaa23d188afb4e9 100644 (file)
 #    under the License.
 
 
-import sys
 import os
 
 import eventlet
 import json
-import nose
 import mox
 import unittest
 
@@ -223,11 +221,6 @@ class VolumeTest(unittest.TestCase):
 
         self.m.VerifyAll()
 
-    # allows testing of the test directly, shown below
-    if __name__ == '__main__':
-        sys.argv.append(__file__)
-        nose.main()
-
 
 class FakeVolume:
     status = 'attaching'
index 314c9b36bf25766f44cf58b3900229a8f3080316..5c0c003d5695f00cff7a0f7d3822243c90886078 100644 (file)
@@ -13,9 +13,6 @@
 #    under the License.
 
 
-import sys
-
-import nose
 import unittest
 import mox
 
@@ -114,8 +111,3 @@ class QuantumTest(unittest.TestCase):
 
         self.assertEqual(None, resource.delete())
         self.m.VerifyAll()
-
-    # allows testing of the test directly, shown below
-    if __name__ == '__main__':
-        sys.argv.append(__file__)
-        nose.main()
index 03d0a6c23b4be869c9275f30633ffd9f8c9b2fb0..65f53342ec663c4ba1a489540527d6cef73b6c12 100644 (file)
 
 import json
 import mox
-import sys
 import uuid
 import time
 
 import eventlet
-import nose
 import unittest
 from nose.plugins.attrib import attr
 from heat.tests import fakes
@@ -234,8 +232,3 @@ class WaitConditionHandleTest(unittest.TestCase):
         stack.delete()
 
         self.m.VerifyAll()
-
-# allows testing of the test directly
-if __name__ == '__main__':
-    sys.argv.append(__file__)
-    nose.main()
index c453d5f4e09eb4eb4bd2753434538cb5c30b7f23..8a61a4facea2bd4e19dcf3bc6bede7acd936092c 100644 (file)
@@ -15,7 +15,6 @@
 
 import datetime
 import mox
-import nose
 from nose.plugins.attrib import attr
 from nose import with_setup
 import unittest