-
Notifications
You must be signed in to change notification settings - Fork 24
Made datetime attribute insert and match time-zone invariant #301
Changes from 10 commits
937d72a
59c877e
bad0eb3
2446f45
e2029b3
010f80b
652e1b4
e67ae30
354f443
b814dc9
b502e73
9e22dac
c838a5e
b0880d6
2be873a
0735e4c
bbf2caf
a39b8c4
1d5cadf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,8 @@ | |
from typedb.client import * | ||
|
||
from tests.behaviour.context import Context | ||
import os | ||
import time | ||
|
||
|
||
@step("attribute({type_label}) get instances contain: {var:Var}") | ||
|
@@ -149,3 +151,10 @@ def step_impl(context: Context, var: str, value: str): | |
@step("attribute {var:Var} has datetime value: {value:DateTime}") | ||
def step_impl(context: Context, var: str, value: datetime): | ||
assert_that(context.get(var).as_attribute().get_value(), is_(value)) | ||
|
||
|
||
@step("set time-zone is: {time_zone_label}") | ||
def step_impl(context: Context, time_zone_label: str): | ||
os.environ["TZ"] = time_zone_label | ||
time.tzset() | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we reset it after our test is done, so we don't affect other tests? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have to do it in typedb-behaviour. Can we assume that the server time is always UTC? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, we can't assume that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updating my comment with what Joshua said: |
Uh oh!
There was an error while loading. Please reload this page.