Skip to content

Commit f49a2b2

Browse files
author
bfolie
authored
Merge pull request #92 from CitrineInformatics/bug/sac-mock-failure
Adpated S&C demo to named instead of indexed json structure
2 parents 08b9978 + 97dbe16 commit f49a2b2

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

taurus/demo/strehlow_and_cook.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ def make_display_table(structured):
465465

466466
print("\n\nJSON -- Training table")
467467
import taurus.json as je
468-
print(json.dumps(json.loads(je.dumps(full_table))[1], indent=2))
468+
print(json.dumps(json.loads(je.dumps(full_table))["object"], indent=2))
469469

470470
print("\n\nCSV -- Display table")
471471
display = make_display_table(full_table)

taurus/demo/tests/test_sac.py

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from taurus.demo.strehlow_and_cook import make_strehlow_table, make_strehlow_objects, \
33
minimal_subset, import_table
44
import taurus.json as je
5+
import json
56

67

78
def test_sac():
@@ -21,3 +22,6 @@ def test_sac():
2122
# Make sure there's no migration with repeated serialization
2223
for row in sac_tbl:
2324
assert je.dumps(je.loads(je.dumps(row))) == je.dumps(row)
25+
26+
# Verify that the serialization trick for mocking a structured table works
27+
json.dumps(json.loads(je.dumps(sac_tbl))["object"], indent=2)

0 commit comments

Comments
 (0)