Skip to content

Commit

Permalink
Improve unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hunyadi committed Jan 11, 2024
1 parent 0959f3d commit c359cf6
Show file tree
Hide file tree
Showing 2 changed files with 243 additions and 108 deletions.
7 changes: 5 additions & 2 deletions pysqlsync/dialect/oracle/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
)
from .object_types import OracleObjectFactory

MIN_DATETIME = datetime.datetime.min.replace(tzinfo=datetime.timezone.utc)
MIN_DATE = datetime.date.min


class OracleGenerator(BaseGenerator):
"Generator for Oracle."
Expand Down Expand Up @@ -100,9 +103,9 @@ def get_field_extractor(
elif field_type is datetime.time:
return (
lambda obj: datetime.datetime.combine(
datetime.date.min, getattr(obj, field_name)
MIN_DATE, getattr(obj, field_name)
)
- datetime.datetime.min
- MIN_DATETIME
)

return super().get_field_extractor(column, field_name, field_type)
Expand Down
Loading

0 comments on commit c359cf6

Please sign in to comment.