| Total Complexity | 4 |
| Total Lines | 17 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | #!/usr/bin/env python |
||
| 10 | class DocumentSerializationTests(unittest.TestCase): |
||
| 11 | |||
| 12 | def test_doc_load_from_json(self): |
||
| 13 | "Document.load_from_JSON should produce a Document from serialized_doc.json" |
||
| 14 | json_file = os.path.join(__location__, "serialized_doc.json") |
||
| 15 | print(json_file) |
||
| 16 | with open(json_file, "r") as jf: |
||
| 17 | doc = Document.load_from_JSON(json.load(jf)) |
||
| 18 | self.assertTrue(isinstance(doc, Document), "Document.load_from_JSON did not produce a Document from {}".format(json_file)) |
||
| 19 | |||
| 20 | def test_sentence_load_from_json(self): |
||
| 21 | "Sentence.load_from_JSON should produce a Sentence from serialized_sentence.json" |
||
| 22 | json_file = os.path.join(__location__, "serialized_sentence.json") |
||
| 23 | print(json_file) |
||
| 24 | with open(json_file, "r") as jf: |
||
| 25 | s = Sentence.load_from_JSON(json.load(jf)) |
||
| 26 | self.assertTrue(isinstance(s, Sentence), "Sentence.load_from_JSON did not produce a Sentence from {}".format(json_file)) |
||
| 27 | |||
| 30 |