Пример #1
0
        pass

    def test_inf_policy(self):
        # If the policy always returns CONT, the sandbox should terminate with
        # BP after the sandboxed program has gone leaving no further events
        import sandbox

        class InfPolicy(sandbox.SandboxPolicy):

            def __call__(self, e, a):
                return a

            pass

        s_wr = open("/dev/null", "wb")
        s = sandbox.Sandbox(self.task, policy=InfPolicy(), stdout=s_wr)
        s.run()
        s_wr.close()
        self.assertEqual(s.result, sandbox.S_RESULT_BP)
        pass

    pass


def test_suite():
    return unittest.TestSuite([
        unittest.TestLoader().loadTestsFromTestCase(eval(c)) for c in __all__])

if __name__ == '__main__':
    unittest.main(defaultTest='test_suite')