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("MolecularSequence", js["resourceType"])
     return molecularsequence.MolecularSequence(js)
    def testMolecularSequence3(self):
        inst = self.instantiate_from("sequence-example-fda-vcfeval.json")
        self.assertIsNotNone(
            inst, "Must have instantiated a MolecularSequence instance")
        self.implMolecularSequence3(inst)

        js = inst.as_json()
        self.assertEqual("MolecularSequence", js["resourceType"])
        inst2 = molecularsequence.MolecularSequence(js)
        self.implMolecularSequence3(inst2)
    def testMolecularSequence1(self):
        inst = self.instantiate_from(
            "sequence-genetics-example-breastcancer.json")
        self.assertIsNotNone(
            inst, "Must have instantiated a MolecularSequence instance")
        self.implMolecularSequence1(inst)

        js = inst.as_json()
        self.assertEqual("MolecularSequence", js["resourceType"])
        inst2 = molecularsequence.MolecularSequence(js)
        self.implMolecularSequence1(inst2)