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 some tests #21

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

Always

Just for now

No changes.
@@ -0,0 +1,17 @@
import unittest
import zipfile
import io
from unittest.mock import patch

import pythonfuzz

class TestFindCrash(unittest.TestCase):
def test_find_crash(self):
def fuzz(buf):
f = io.BytesIO(buf)
z = zipfile.ZipFile(f)
z.testzip()

with patch('logging.Logger.info') as mock:
pythonfuzz.fuzzer.Fuzzer(fuzz).start()
self.assertTrue(mock.called_once)
@@ -0,0 +1,15 @@
import unittest
import zipfile
import io
from unittest.mock import patch

import pythonfuzz

class TestFindCrash(unittest.TestCase):
def test_find_crash(self):
def fuzz(buf):
return True

with patch('logging.Logger.info') as mock:
pythonfuzz.fuzzer.Fuzzer(fuzz, runs=100).start()
mock.assert_called_with('did %d runs, stopping now.', 100)
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.