コード例 #1
0
    def testCPUPHP(self):
        """Should be able to note CPU fatal error (in PHP)."""

        # This test intentionally takes a few seconds to run.

        # Code is originally from
        # https://scraperwiki.com/scrapers/cpu-php/edit/
        code = """<?php
echo "php started\n";
set_time_limit(1);
$x=2;
while(true) {
    $a = $x*$x;
}
?>
"""

        stuff = self.Execute(code, language='php')
        output = testbase.exceptions(stuff)
        assert 'Maximum execution time' in output
コード例 #2
0
ファイル: testcore.py プロジェクト: imclab/ScraperWikiX
    def testCPUPHP(self):
        """Should be able to note CPU fatal error (in PHP)."""

        # This test intentionally takes a few seconds to run.

        # Code is originally from
        # https://scraperwiki.com/scrapers/cpu-php/edit/
        code = """<?php
echo "php started\n";
set_time_limit(1);
$x=2;
while(true) {
    $a = $x*$x;
}
?>
"""

        stuff = self.Execute(code, language='php')
        output = testbase.exceptions(stuff)
        assert 'Maximum execution time' in output
コード例 #3
0
 def testBinaryAssert(self):
     """Should be able to see assert text, even when non UTF-8."""
     stuff = self.Execute(r"""assert '','\xabAsserted\xbb'""")
     output = testbase.exceptions(stuff)
     assert "Asserted" in output
コード例 #4
0
ファイル: testconsole.py プロジェクト: imclab/ScraperWikiX
 def testBinaryAssert(self):
     """Should be able to see assert text, even when non UTF-8."""
     stuff = self.Execute(r"""assert '','\xabAsserted\xbb'""")
     output = testbase.exceptions(stuff)
     assert 'Asserted' in output