Beispiel #1
0
 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'})
Beispiel #2
0
 def testNoArgs(self):
     m = Map()
     m.put(KVPair('foo', 42))
     f = Function(m)
     r = f.call()
     self.assertEqual(r, {'foo': 42})
Beispiel #3
0
 def testOneArg(self):
     m = Map()
     m.put(KVPair('foo', NameRef('arg')))
     f = Function(m, ['arg'])
     r = f.call(42)
     self.assertEqual(r, {'foo': 42})