Skip to content

Commit

Permalink
fixed bug with datetime compare
Browse files Browse the repository at this point in the history
  • Loading branch information
TamarZanzouri committed Feb 15, 2024
1 parent 6e49fe4 commit cd678f5
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions robot-server/tests/protocols/test_protocol_analyzer.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Tests for the ProtocolAnalyzer."""
import pytest
from decoy import Decoy
from datetime import datetime, timezone
from decoy import Decoy, matchers
from datetime import datetime
from pathlib import Path

from opentrons_shared_data.robot.dev_types import RobotType
Expand Down Expand Up @@ -185,10 +185,10 @@ async def test_analyze_updates_pending_on_error(

raised_exception = Exception("You got me!!")

error_occurrence = pe_errors.ErrorOccurrence(
error_occurrence = pe_errors.ErrorOccurrence.construct(
id="internal-error",
createdAt=datetime(year=2023, month=3, day=3),
errorType="PythonException",
createdAt=matchers.IsA(datetime),
errorType="EnumeratedError",
detail="You got me!!",
)

Expand Down Expand Up @@ -216,8 +216,6 @@ async def test_analyze_updates_pending_on_error(
enumerated_error
)

decoy.when(datetime.now(tz=timezone.utc)).then_return(datetime(year=2023, month=3, day=3))

await subject.analyze(
protocol_resource=protocol_resource,
analysis_id="analysis-id",
Expand Down

0 comments on commit cd678f5

Please sign in to comment.