import unittest
from parameterized import parameterized
from som.vm.universe import Universe


class SomTest(unittest.TestCase):
    @parameterized.expand([
        ("ClassStructure",),
        ("Array"         ,),
        ("Block"         ,),
        ("ClassLoading"  ,),

        ("Closure"       ,),
        ("Coercion"      ,),
        ("CompilerReturn",),
        ("Double"        ,),

        ("Empty"         ,),
        ("Hash"          ,),
        ("Integer"       ,),
        ("ObjectSize"    ,),

        ("Preliminary"   ,),
        ("Reflection"    ,),
        ("SelfBlock"     ,),
        ("Super"         ,),

        ("String"        ,),
        ("Symbol"        ,),
        ("System"        ,),
        ("Vector"        ,)])
    def test_som_test(self, test_name):
        args = ["-cp", "Smalltalk", "TestSuite/TestHarness.som", test_name]
        u = Universe(True)
        u.interpret(args)
        
        self.assertEquals(0, u.last_exit_code())

import sys
if sys.modules.has_key('pytest'):
    # hack to make pytest not to collect the unexpanded test method
    delattr(SomTest, "test_som_test")

import unittest
from parameterized import parameterized
from som.vm.universe import Universe


class SomTest(unittest.TestCase):
    @parameterized.expand([
        ("ClassStructure",),
        ("Array"         ,),
        ("Block"         ,),
        ("ClassLoading"  ,),

        ("Closure"       ,),
        ("Coercion"      ,),
        ("CompilerReturn",),
        ("Double"        ,),

        ("Empty"         ,),
        ("Hash"          ,),
        ("Integer"       ,),
        ("ObjectSize"    ,),

        ("Preliminary"   ,),
        ("Reflection"    ,),
        ("SelfBlock"     ,),
        ("Super"         ,),

        ("String"        ,),
        ("Symbol"        ,),
        ("System"        ,),
        ("Vector"        ,)])
    def test_som_test(self, test_name):
        args = ["-cp", "Smalltalk", "TestSuite/TestHarness.som", test_name]
        u = Universe(True)
        u.interpret(args)
        
        self.assertEquals(0, u.last_exit_code())

import sys

if 'pytest' in sys.modules:
    # hack to make pytest not to collect the unexpanded test method
    delattr(SomTest, "test_som_test")

Use in, because has_key seems to be deprecated
Use in, because has_key seems to be deprecated

Signed-off-by: Stefan Marr <46f1a0bd5592a2f9244ca321b129902a06b53e03@stefan-marr.de>
