Skip to content

Commit

Permalink
Fix unit tests by updating Branch type
Browse files Browse the repository at this point in the history
  • Loading branch information
radao committed Jul 17, 2023
1 parent 5200607 commit 5e1e359
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions doltcli/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class BranchT(BaseDataclass):
latest_committer_email: Optional[str] = None
latest_commit_date: Optional[datetime.datetime] = None
latest_commit_message: Optional[str] = None
remote: Optional[str] = None
branch: Optional[str] = None


@dataclass
Expand Down
4 changes: 3 additions & 1 deletion tests/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ def test_datetime_serialize():
latest_commit_date=dt,
latest_committer_email=None,
latest_commit_message=None,
remote=None,
branch=None,
)
br = Branch(**cmp)
assert br.dict() == cmp
assert (
br.json()
== """
{"name": "test", "hash": "23", "latest_committer": null, "latest_committer_email": null, "latest_commit_date": "2018-06-29 00:00:00", "latest_commit_message": null}
{"name": "test", "hash": "23", "latest_committer": null, "latest_committer_email": null, "latest_commit_date": "2018-06-29 00:00:00", "latest_commit_message": null, "remote": null, "branch": null}
""".strip()
)

0 comments on commit 5e1e359

Please sign in to comment.