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 8634fc6
Show file tree
Hide file tree
Showing 3 changed files with 245 additions and 108 deletions.
2 changes: 2 additions & 0 deletions .github/actions/test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ runs:
- name: Fetch unit and/or integration tests
uses: actions/checkout@v4
with:
# include `.github` to allow post-run for this composite action
sparse-checkout: |
.
.github
tests
- name: Install test requirements
Expand Down
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 8634fc6

Please sign in to comment.