Skip to content

Commit 21ed06b

Browse files
committed
add json parse to test
1 parent b93b398 commit 21ed06b

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

irods/test/rule_test.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#! /usr/bin/env python
22
# -*- coding: utf-8 -*-
33

4+
import json
45
import os
56
import sys
67
import random
@@ -459,8 +460,9 @@ def test_rule_exec_context(self):
459460
l = list(self.sess.query(RuleExec).filter(Like(RuleExec.name,f'%"{random_int}"%')))
460461
rule_id = l[0][RuleExec.id]
461462

462-
# Assert context exists, is of string type, and is not empty.
463-
self.assertGreater(l[0][RuleExec.context], "")
463+
# Assert context exists, and is JSON-parsable with a non-null-length result.
464+
rule_context = l[0][RuleExec.context]
465+
self.assertGreater(len(json.loads(rule_context)), 0)
464466
finally:
465467
# Remove the delayed rule from the queue.
466468
if rule_id >= 0:

0 commit comments

Comments
 (0)