@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
import datetime as dt
-import dateutil.tz
import mutagen
import os
import re
@@ -11,10 +10,7 @@ import symuid.tag_interface
def _timestamp_to_utc_dt(ts):
return dt.datetime.utcfromtimestamp(ts) \
- .replace(tzinfo=dateutil.tz.tzutc())
-
-assert _timestamp_to_utc_dt(1528795204) \
- == dt.datetime(2018, 6, 12, 9, 20, 4, tzinfo=dateutil.tz.tzutc())
+ .replace(tzinfo=dt.timezone.utc)
class PlayCount:
@@ -0,0 +1,11 @@
+import pytest
+
+import symuid
+import datetime as dt
+@pytest.mark.parametrize(('ts', 'expected_dt'), [
+ (1528795204, dt.datetime(2018, 6, 12, 9, 20, 4, tzinfo=dt.timezone.utc)),
+])
+def test__timestamp_to_utc_dt(ts, expected_dt):
+ assert expected_dt == symuid._timestamp_to_utc_dt(ts)