def testTwoArgs(self): m = Map() m.put(KVPair('foo', NameRef('arg1'))) m.put(KVPair('bar', NameRef('arg2'))) f = Function(m, ['arg1', 'arg2']) r = f.call(42, 'ackup') self.assertEqual(r, {'foo': 42,'bar':'ackup'})
def testNoArgs(self): m = Map() m.put(KVPair('foo', 42)) f = Function(m) r = f.call() self.assertEqual(r, {'foo': 42})
def testOneArg(self): m = Map() m.put(KVPair('foo', NameRef('arg'))) f = Function(m, ['arg']) r = f.call(42) self.assertEqual(r, {'foo': 42})