From cc1132a5b4677d089e024bcd0e16e1e817a3581c Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Tue, 25 Dec 2018 18:56:55 +0100 Subject: warc: Add tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using hyothesis-based testcase generation. This is quite nice compared to manual test data generation, since it catches alot more corner cases (if done right). This commit also fixes a few issues, including: - log records will only be written if the log is nonempty - properly quote packageUrl path’s - drop old thread checking code - use placeholder url for scripts without name --- crocoite/behavior.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'crocoite/behavior.py') diff --git a/crocoite/behavior.py b/crocoite/behavior.py index 7f3a3a0..dcab33a 100644 --- a/crocoite/behavior.py +++ b/crocoite/behavior.py @@ -197,6 +197,9 @@ class DomSnapshotEvent: __slots__ = ('url', 'document', 'viewport') def __init__ (self, url, document, viewport): + # XXX: document encoding? + assert isinstance (document, bytes) + self.url = url self.document = document self.viewport = viewport -- cgit v1.2.3