def test_object(self): vm = perl5.VM() ret = vm.eval(SCRIPT) self.assertEqual(ret, 1) o = vm.package("Px::Testing").new() self.assertIsInstance(o, Proxy) o2 = vm.package("Px::Testing").new() self.assertNotEqual(o, o2) method = o.method self.assertIsInstance(method, CodeRefProxy) self.assertEqual(method, o.method) ret = method(1) self.assertEqual(ret, 1)
def setUp(self): self.vm = vm = perl5.VM() vm.eval(SCRIPT)
def test_type(self): vm = perl5.VM() self.assertIsInstance(vm, VM) self.assertIsInstance(vm.type_mapper, TypeMapper)