Fixed timezone related test failure

This commit is contained in:
Simon Willison 2023-07-01 11:14:25 -07:00
parent 4d304d99e1
commit 6ef52172b0
2 changed files with 3 additions and 3 deletions

View file

@ -46,7 +46,7 @@ def register_commands(cli):
to_print = []
for model in models:
# Print id, owned_by, root, created as ISO 8601
created_str = datetime.datetime.fromtimestamp(
created_str = datetime.datetime.utcfromtimestamp(
model["created"]
).isoformat()
to_print.append(

View file

@ -34,6 +34,6 @@ def test_openai_models(mocked_models):
assert result.exit_code == 0
assert result.output == (
"id owned_by created \n"
"ada:2020-05-03 openai 2020-05-03T13:26:40\n"
"babbage:2020-05-03 openai 2020-05-03T13:26:40\n"
"ada:2020-05-03 openai 2020-05-03T20:26:40\n"
"babbage:2020-05-03 openai 2020-05-03T20:26:40\n"
)