This fixes the pytest problem which threw: TypeError: isinstance() arg 2 must be a type, a tuple of types, or a union during Mocking
34 lines
794 B
Python
34 lines
794 B
Python
#!/usr/bin/env -S uv run --script
|
|
|
|
"""
|
|
Test for double byte format
|
|
"""
|
|
|
|
from zoneinfo import ZoneInfo
|
|
from corelibs.string_handling.timestamp_strings import TimestampStrings
|
|
|
|
|
|
def main():
|
|
"""test"""
|
|
ts = TimestampStrings()
|
|
print(f"TS: {ts.timestamp_now}")
|
|
|
|
try:
|
|
ts = TimestampStrings("invalid")
|
|
except ValueError as e:
|
|
print(f"Value error: {e}")
|
|
|
|
ts = TimestampStrings("Europe/Vienna")
|
|
print(f"TZ: {ts.time_zone} -> TS: {ts.timestamp_now_tz}")
|
|
ts = TimestampStrings(ZoneInfo("Europe/Vienna"))
|
|
print(f"TZ: {ts.time_zone} -> TS: {ts.timestamp_now_tz}")
|
|
custom_tz = 'Europe/Paris'
|
|
ts = TimestampStrings(time_zone=custom_tz)
|
|
print(f"TZ: {ts.time_zone} -> TS: {ts.timestamp_now_tz}")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|
|
|
|
# __END__
|