Skip to content

Commit dbbd5ea

Browse files
authored
Add tests for boolean summary fields (#268)
`contains-system-updates` and `contains-updates`
1 parent c43ba65 commit dbbd5ea

File tree

5 files changed

+74
-0
lines changed

5 files changed

+74
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
!: BOLT 4.4
2+
3+
A: HELLO {"{}": "*"}
4+
*: RESET
5+
C: RUN "*" "*" "*"
6+
S: SUCCESS {"t_first": 2001, "fields": ["n"]}
7+
C: PULL {"n": "*"}
8+
S: RECORD [1]
9+
SUCCESS {"type": "r", "db": "apple", "t_last": 2002, "stats": {"contains-system-updates": true}}
10+
*: RESET
11+
?: GOODBYE
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
!: BOLT 4.4
2+
3+
A: HELLO {"{}": "*"}
4+
*: RESET
5+
C: RUN "*" "*" "*"
6+
S: SUCCESS {"t_first": 2001, "fields": ["n"]}
7+
C: PULL {"n": "*"}
8+
S: RECORD [1]
9+
SUCCESS {"type": "r", "db": "apple", "t_last": 2002, "stats": {"contains-updates": true}}
10+
*: RESET
11+
?: GOODBYE
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
!: BOLT 4.4
2+
3+
A: HELLO {"{}": "*"}
4+
*: RESET
5+
C: RUN "*" "*" "*"
6+
S: SUCCESS {"t_first": 2001, "fields": ["n"]}
7+
C: PULL {"n": "*"}
8+
S: RECORD [1]
9+
SUCCESS {"type": "r", "db": "apple", "t_last": 2002, "stats": {"system-updates": 1234, "contains-system-updates": false}}
10+
*: RESET
11+
?: GOODBYE
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
!: BOLT 4.4
2+
3+
A: HELLO {"{}": "*"}
4+
*: RESET
5+
C: RUN "*" "*" "*"
6+
S: SUCCESS {"t_first": 2001, "fields": ["n"]}
7+
C: PULL {"n": "*"}
8+
S: RECORD [1]
9+
SUCCESS {"type": "r", "db": "apple", "t_last": 2002, "stats": {"constraints-added": 1234, "contains-updates": false}}
10+
*: RESET
11+
?: GOODBYE

tests/stub/summary/test_summary.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,36 @@ def test_partial_summary_constraints_removed(self):
302302
summary, constraints_removed=1234, contains_updates=True
303303
)
304304

305+
@driver_feature(types.Feature.TMP_FULL_SUMMARY)
306+
def test_partial_summary_contains_system_updates(self):
307+
summary = self._get_summary(
308+
"partial_summary_contains_system_updates.script"
309+
)
310+
self._assert_counters(summary, contains_system_updates=True)
311+
312+
@driver_feature(types.Feature.TMP_FULL_SUMMARY)
313+
def test_partial_summary_contains_updates(self):
314+
summary = self._get_summary("partial_summary_contains_updates.script")
315+
self._assert_counters(summary, contains_updates=True)
316+
317+
@driver_feature(types.Feature.TMP_FULL_SUMMARY)
318+
def test_partial_summary_not_contains_system_updates(self):
319+
summary = self._get_summary(
320+
"partial_summary_not_contains_system_updates.script"
321+
)
322+
self._assert_counters(
323+
summary, system_updates=1234, contains_system_updates=False
324+
)
325+
326+
@driver_feature(types.Feature.TMP_FULL_SUMMARY)
327+
def test_partial_summary_not_contains_updates(self):
328+
summary = self._get_summary(
329+
"partial_summary_not_contains_updates.script"
330+
)
331+
self._assert_counters(
332+
summary, constraints_added=1234, contains_updates=False
333+
)
334+
305335
@driver_feature(types.Feature.TMP_FULL_SUMMARY)
306336
def test_partial_summary_indexes_added(self):
307337
summary = self._get_summary("partial_summary_indexes_added.script")

0 commit comments

Comments
 (0)