Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
phoerious committed Aug 9, 2024
1 parent feb6cce commit 360a19c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions resiliparse/resiliparse_inc/zlib.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ cdef extern from "<zlib.h>" nogil:
unsigned int avail_out
unsigned long total_out
const char* msg
void* zalloc
void* zfree
void* opaque
const void* zalloc
const void* zfree
const void* opaque

const void* Z_NULL

Expand Down
7 changes: 4 additions & 3 deletions tests/fastwarc/test_warc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from base64 import b32encode
import brotli
import datetime
from email.utils import format_datetime
import gzip
import lz4.frame
Expand Down Expand Up @@ -221,13 +222,13 @@ def test_record_date():
assert new_rec.record_date is not None
assert new_rec.record_date.tzinfo is datetime.timezone.utc

dt_now_utc = datetime.datetime.utcnow().replace(microsecond=0).astimezone(datetime.timezone.utc)
dt_now_utc = datetime.datetime.now(datetime.timezone.utc).replace(microsecond=0).astimezone(datetime.timezone.utc)
new_rec.record_date = dt_now_utc
assert new_rec.record_date == dt_now_utc
assert new_rec.record_date.tzinfo == datetime.timezone.utc
assert new_rec.headers['WARC-Date'] == dt_now_utc.isoformat().replace('+00:00', 'Z')

dt_now_utc2 = datetime.datetime.utcnow().astimezone(datetime.timezone(datetime.timedelta(hours=2)))
dt_now_utc2 = datetime.datetime.now(datetime.timezone.utc).astimezone(datetime.timezone(datetime.timedelta(hours=2)))
assert dt_now_utc2.isoformat().endswith('+02:00')
new_rec.record_date = dt_now_utc2
assert new_rec.record_date == dt_now_utc2
Expand Down Expand Up @@ -390,7 +391,7 @@ def test_record_http_parsing():
assert rec.http_date.tzinfo
rec.http_headers['Date'] = 'Invalid Date'
assert rec.http_date is None
now_date = datetime.datetime.utcnow().replace(microsecond=0)
now_date = datetime.datetime.now(datetime.timezone.utc).replace(microsecond=0)
rec.http_headers['Date'] = format_datetime(now_date)
assert rec.http_date == now_date

Expand Down

0 comments on commit 360a19c

Please sign in to comment.