Exemplo n.º 1
0
    def test_parse_medium_yaml_list(self):
        self.write_model_file(
            'medium.yaml', '\n'.join([
                'compartment: e', 'compounds:', '  - id: cpd_A',
                '    lower: -42'
            ]))

        path = os.path.join(self._model_dir, 'fake.yaml')
        medium = list(
            native.parse_medium_list(
                path, [{
                    'include': 'medium.yaml'
                }, {
                    'compartment': 'e',
                    'compounds': [{
                        'id': 'cpd_B',
                        'upper': 767
                    }]
                }], 'e'))

        self.assertEqual(medium, [(Compound('cpd_A', 'e'), None, -42, None),
                                  (Compound('cpd_B', 'e'), None, None, 767)])
Exemplo n.º 2
0
    def test_parse_medium_yaml_list(self):
        self.write_model_file('medium.yaml', '\n'.join([
            'compartment: e',
            'compounds:',
            '  - id: cpd_A',
            '    lower: -42'
        ]))

        path = os.path.join(self._model_dir, 'fake.yaml')
        medium = list(native.parse_medium_list(path, [
            {'include': 'medium.yaml'},
            {
                'compartment': 'e',
                'compounds': [
                    {'id': 'cpd_B', 'upper': 767}
                ]
            }
        ]))

        self.assertEqual(medium, [
            (Compound('cpd_A', 'e'), None, -42, None),
            (Compound('cpd_B', 'e'), None, None, 767)
        ])