Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add makefile runner for tests #29

Merged
merged 3 commits into from Jan 13, 2020
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Ensure that test_crash checks the file and cleans up after itself.

The test for a crash now checks that the file was actually created
and that we clean that file up afterward, so that we don't affect
other runs.
  • Loading branch information
gerph committed Jan 11, 2020
commit 6c7dae6d12fe2282f5d626aa556229638b36ba3e
@@ -1,6 +1,7 @@
import io
import os
import unittest
import zipfile
import io

try:
from unittest.mock import patch
@@ -28,3 +29,10 @@ def fuzz(buf):
with patch('logging.Logger.info') as mock:
pythonfuzz.fuzzer.Fuzzer(fuzz).start()
self.assertTrue(mock.called_once)

# Check that we created a crash file
# (this is the hash of an empty string, because we know that the first call is with an empty string)
self.assertTrue(os.path.exists('crash-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'))

# Clean up after ourselves
os.remove('crash-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855')
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.