-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: to
timezone
specific datetime
helpers to avoid use depr…
…ecated functions (#86)
- Loading branch information
Showing
3 changed files
with
20 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import datetime | ||
import unittest | ||
|
||
from influxdb_client_3.write_client.client.write.point import EPOCH, Point | ||
|
||
|
||
class TestPoint(unittest.TestCase): | ||
|
||
def test_epoch(self): | ||
self.assertEqual(EPOCH, datetime.datetime(1970, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)) | ||
|
||
def test_point(self): | ||
point = Point.measurement("h2o").tag("location", "europe").field("level", 2.2).time(1_000_000) | ||
self.assertEqual('h2o,location=europe level=2.2 1000000', point.to_line_protocol()) |