def testStarArgs(self):
        args = (1,2)
        res = aArgs(*args)
        self.assertEquals(args, res)

        args = "123"
        try:
            res = aArgs(*args)
            called = True
            exc = None
        except TypeError, e:
            called = False
            exc = e

        # weird one: a string is a sequence, so it gets away with being
        # called on its own as *args! eeugh.
        self.assertTrue(called,
                    "exception not expected but function called:" + repr(res) + repr(exc))
        self.assertEquals(res, ("1", "2", "3"))


        args = 1
        try:
            res = aArgs(*args)
            called = True
        except __HOLE__:
            called = False

        self.assertFalse(called,
                    "exception expected but not raised - TypeError: aArgs() argument after * must be a sequence")


        args = (1,)
        res = aArgs(*args)
        self.assertEquals(args, res)

        args = (1,)
        res = aArgs(args)
        self.assertEquals((args,), res)
dataset/ETHPy150Open pyjs/pyjs/examples/libtest/ArgsTest.py/ArgsTest.testStarArgs