Example #1
0
 def instantiate_from(self, filename):
     datadir = os.environ.get('FHIR_UNITTEST_DATADIR') or \
               os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', 'fhir-parser', 'downloads'))
     with io.open(os.path.join(datadir, filename), 'r',
                  encoding='utf-8') as handle:
         js = json.load(handle)
         self.assertEqual("List", js["resourceType"])
     return list.List(js)
Example #2
0
    def testList3(self):
        inst = self.instantiate_from("list-example-simple-empty.json")
        self.assertIsNotNone(inst, "Must have instantiated a List instance")
        self.implList3(inst)

        js = inst.as_json()
        self.assertEqual("List", js["resourceType"])
        inst2 = list.List(js)
        self.implList3(inst2)
Example #3
0
    def testList2(self):
        inst = self.instantiate_from(
            "list-example-familyhistory-genetics-profile-annie.json")
        self.assertIsNotNone(inst, "Must have instantiated a List instance")
        self.implList2(inst)

        js = inst.as_json()
        self.assertEqual("List", js["resourceType"])
        inst2 = list.List(js)
        self.implList2(inst2)
Example #4
0
    def testList9(self):
        inst = self.instantiate_from(
            "list-example-double-cousin-relationship-pedigree.json")
        self.assertIsNotNone(inst, "Must have instantiated a List instance")
        self.implList9(inst)

        js = inst.as_json()
        self.assertEqual("List", js["resourceType"])
        inst2 = list.List(js)
        self.implList9(inst2)