Skip to content

Commit

Permalink
Fixed bytes tests
Browse files Browse the repository at this point in the history
Signed-off-by: ammar <[email protected]>
  • Loading branch information
ammar92 committed Oct 25, 2023
1 parent 5dc8431 commit 0c963e9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
9 changes: 5 additions & 4 deletions bytes/tests/loading.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import datetime
import json
from datetime import timezone
from typing import Any, Dict, Optional
Expand Down Expand Up @@ -40,8 +41,8 @@ def get_boefje_meta(
input_ooi=input_ooi,
arguments={"domain": "test.org"},
organization="test",
started_at=AwareDatetime(1000, 10, 10, 10, 10, 10, tzinfo=timezone.utc),
ended_at=AwareDatetime(1000, 10, 10, 10, 10, 11, tzinfo=timezone.utc),
started_at=datetime.datetime(1000, 10, 10, 10, 10, 10, tzinfo=timezone.utc),
ended_at=datetime.datetime(1000, 10, 10, 10, 10, 11, tzinfo=timezone.utc),
)


Expand All @@ -50,8 +51,8 @@ def get_normalizer_meta(raw_file_id: UUID = UUID("2c9f47db-dfca-4928-b29f-368e64
id=UUID("203eedee-a590-43e1-8f80-6d18ffe529f5"),
raw_data=get_raw_data_meta(raw_file_id),
normalizer=Normalizer(id="kat_test.main"),
started_at=AwareDatetime(year=1001, month=10, day=10, hour=10, minute=10, second=10, tzinfo=timezone.utc),
ended_at=AwareDatetime(year=1001, month=10, day=10, hour=10, minute=10, second=12, tzinfo=timezone.utc),
started_at=datetime.datetime(year=1001, month=10, day=10, hour=10, minute=10, second=10, tzinfo=timezone.utc),
ended_at=datetime.datetime(year=1001, month=10, day=10, hour=10, minute=10, second=12, tzinfo=timezone.utc),
)


Expand Down
5 changes: 3 additions & 2 deletions bytes/tests/unit/test_hash.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import datetime
from datetime import timezone
from unittest import TestCase

Expand All @@ -10,7 +11,7 @@

class HashTests(TestCase):
def test_hash_same_data(self) -> None:
dt = AwareDatetime(year=2022, month=1, day=1, hour=0, minute=0, second=0, tzinfo=timezone.utc)
dt = datetime.datetime(year=2022, month=1, day=1, hour=0, minute=0, second=0, tzinfo=timezone.utc)

secure_hash = hash_data(data=get_raw_data(), datetime=dt)

Expand All @@ -29,7 +30,7 @@ def test_hash_same_data(self) -> None:
)

def test_hash_sha224(self) -> None:
dt = AwareDatetime(year=2022, month=1, day=1, hour=0, minute=0, second=0, tzinfo=timezone.utc)
dt = datetime.datetime(year=2022, month=1, day=1, hour=0, minute=0, second=0, tzinfo=timezone.utc)

secure_hash = hash_data(data=get_raw_data(), datetime=dt, hash_algo=HashingAlgorithm.SHA224)

Expand Down

0 comments on commit 0c963e9

Please sign in to comment.