Skip to content

Commit

Permalink
callregistry_test: fixed date attributes on tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vokimon committed Jul 18, 2022
1 parent 88a5b0f commit 9933add
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions tomatic/callregistry_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,96 +53,96 @@ def test_updateCall_updatesAfterWrite(self):
def test_updateCall_sameTimeExtension_updates(self):
reg = CallRegistry(self.dir)
reg.updateCall('alice', ns(
data="2021-02-01T20:21:22.555Z",
date="2021-02-01T20:21:22.555Z",
attribute="value",
tag="content",
))
reg.updateCall('alice', ns(
data="2021-02-01T20:21:22.555Z",
date="2021-02-01T20:21:22.555Z",
attribute="second value",
tag="second content",
))
self.assertNsEqual(ns.load(self.dailycalls), """\
alice:
- data: "2021-02-01T20:21:22.555Z"
- date: "2021-02-01T20:21:22.555Z"
attribute: second value
tag: second content
""")
self.assertNsEqual(
ns(calls = reg.callsByUser('alice')), """\
calls:
- data: "2021-02-01T20:21:22.555Z"
- date: "2021-02-01T20:21:22.555Z"
attribute: second value
tag: second content
""")

def test_updateCall_differentTime_appends(self):
reg = CallRegistry(self.dir)
reg.updateCall('alice', ns(
data="2021-02-01T20:21:22.555Z",
date="2021-02-01T20:21:22.555Z",
attribute="value",
tag="content",
))
reg.updateCall('alice', ns(
data="2021-02-02T20:21:22.555Z",
date="2021-02-02T20:21:22.555Z",
attribute="second value",
tag="second content",
))
self.assertNsEqual(ns.load(self.dailycalls), """\
alice:
- attribute: value
tag: content
data: "2021-02-01T20:21:22.555Z"
date: "2021-02-01T20:21:22.555Z"
- attribute: second value
tag: second content
data: "2021-02-02T20:21:22.555Z"
date: "2021-02-02T20:21:22.555Z"
""")
self.assertNsEqual(
ns(calls = reg.callsByUser('alice')), """\
calls:
- data: "2021-02-01T20:21:22.555Z"
- date: "2021-02-01T20:21:22.555Z"
attribute: value
tag: content
- data: "2021-02-02T20:21:22.555Z"
- date: "2021-02-02T20:21:22.555Z"
attribute: second value
tag: second content
""")

def test_updateCall_differentExtension_splits(self):
def test_updateCall_differentUser_splits(self):
reg = CallRegistry(self.dir)

reg.updateCall('alice', ns(
data="2021-02-02T20:21:22.555Z",
date="2021-02-02T20:21:22.555Z",
attribute="value",
tag="content",
))
reg.updateCall('barbara', ns(
data="2021-02-02T20:21:22.555Z",
date="2021-02-02T20:21:22.555Z",
attribute="second value",
tag="second content",
))
self.assertNsEqual(ns.load(self.dailycalls), """\
alice:
- data: "2021-02-02T20:21:22.555Z"
- date: "2021-02-02T20:21:22.555Z"
attribute: value
tag: content
barbara:
- data: "2021-02-02T20:21:22.555Z"
- date: "2021-02-02T20:21:22.555Z"
attribute: second value
tag: second content
""")

self.assertNsEqual(
ns(calls = reg.callsByUser('alice')), """\
calls:
- data: "2021-02-02T20:21:22.555Z"
- date: "2021-02-02T20:21:22.555Z"
attribute: value
tag: content
""")
self.assertNsEqual(
ns(calls = reg.callsByUser('barbara')), """\
calls:
- data: "2021-02-02T20:21:22.555Z"
- date: "2021-02-02T20:21:22.555Z"
attribute: second value
tag: second content
""")
Expand Down

0 comments on commit 9933add

Please sign in to comment.