Get rid of nose.main() in unit test files

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>
This commit is contained in:
Zane Bitter 2012-12-13 15:57:59 +01:00
parent 4fc1f27f12
commit b9e5bcb689
41 changed files with 2 additions and 185 deletions

View File

@ -14,7 +14,6 @@
import util
import verify
import nose
from nose.plugins.attrib import attr
import unittest
import os

View 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

View File

@ -14,7 +14,6 @@
import util
import verify
import nose
from nose.plugins.attrib import attr
import unittest
import os

View File

@ -14,7 +14,6 @@
import util
import verify
import nose
from nose.plugins.attrib import attr
import unittest
import os

View File

@ -14,7 +14,6 @@
import util
import verify
import nose
from nose.plugins.attrib import attr
import unittest
import os

View File

@ -14,7 +14,6 @@
import util
import verify
import nose
from nose.plugins.attrib import attr
import unittest
import os

View File

@ -14,7 +14,6 @@
import util
import verify
import nose
from nose.plugins.attrib import attr
import unittest
import os

View File

@ -14,7 +14,6 @@
import util
import verify
import nose
from nose.plugins.attrib import attr
import unittest
import os

View File

@ -13,7 +13,6 @@
#
import util
import nose
from nose.plugins.attrib import attr
import unittest
import os

View File

@ -15,7 +15,6 @@
import os
import util
import verify
import nose
from nose.plugins.attrib import attr
import unittest
import time

View File

@ -14,7 +14,6 @@
import util
import verify
import nose
from nose.plugins.attrib import attr
import unittest
import os

View File

@ -15,7 +15,6 @@
import os
import util
import verify
import nose
from nose.plugins.attrib import attr
import unittest

View 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()

View 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()

View 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()

View 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()

View 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()

View File

@ -13,10 +13,8 @@
# 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()

View File

@ -13,10 +13,8 @@
# 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()

View 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()

View File

@ -13,10 +13,8 @@
# 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()

View File

@ -13,7 +13,6 @@
# under the License.
import nose
import unittest
from nose.plugins.attrib import attr

View File

@ -13,10 +13,8 @@
# 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()

View 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()

View File

@ -13,10 +13,8 @@
# 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()

View File

@ -14,10 +14,8 @@
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()

View 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()

View File

@ -13,12 +13,10 @@
# 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()

View File

@ -13,7 +13,6 @@
# under the License.
import nose
import pkgutil
import sys
import unittest

View 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()

View File

@ -13,10 +13,8 @@
# 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()

View 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()

View File

@ -13,11 +13,9 @@
# 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()

View File

@ -14,7 +14,6 @@
import json
import mox
import nose
from nose.plugins.attrib import attr
import os
import re

View File

@ -14,7 +14,6 @@
# under the License.
import mox
import nose
from nose.plugins.attrib import attr
import StringIO
import unittest

View File

@ -13,12 +13,10 @@
# 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()

View 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()

View File

@ -13,12 +13,10 @@
# 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'

View 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()

View File

@ -15,12 +15,10 @@
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()

View File

@ -15,7 +15,6 @@
import datetime
import mox
import nose
from nose.plugins.attrib import attr
from nose import with_setup
import unittest