Esempio n. 1
0
 def test_exc(self):
     ds = [{
         "exchanges": [
             {
                 "categories": ("resource", "in ground"),
                 "type": "biosphere",
             },
             {
                 "categories": ("resource", "all around"),
                 "type": "biosphere"
             },
         ]
     }]
     expected = [{
         "exchanges": [
             {
                 "categories": [u"natural resource", u"in ground"],
                 "type": "biosphere",
             },
             {
                 "categories": ("resource", "all around"),
                 "type": "biosphere"
             },
         ]
     }]
     self.assertEqual(expected, normalize_biosphere_categories(ds))
Esempio n. 2
0
 def test_exc(self):
     ds = [{
         'exchanges': [
             {
                 'categories': ('resource', 'in ground'),
                 'type': 'biosphere',
             }, {
                 'categories': ('resource', 'all around'),
                 'type': 'biosphere'
             }
         ]
     }]
     expected = [{
         'exchanges': [
             {
                 'categories': [u'natural resource', u'in ground'],
                 'type': 'biosphere',
             }, {
                 'categories': ('resource', 'all around'),
                 'type': 'biosphere'
             }
         ]
     }]
     self.assertEqual(
         expected,
         normalize_biosphere_categories(ds)
     )
Esempio n. 3
0
 def test_exc_no_categories(self):
     ds = [{
         'exchanges': [{'name': 'foo'}]
     }]
     self.assertEqual(
         ds,
         normalize_biosphere_categories(copy.deepcopy(ds))
     )
Esempio n. 4
0
 def test_ds_wrong_type(self):
     ds = [{
         'categories': ('resource', 'in ground'),
         'type': 'process'
     }]
     self.assertEqual(
         ds,
         normalize_biosphere_categories(copy.deepcopy(ds))
     )
Esempio n. 5
0
 def test_ds(self):
     ds = [
         {"categories": ("resource", "in ground"), "type": "emission"},
         {"categories": ("resource", "all around"), "type": "emission"},
     ]
     expected = [
         {"categories": [u"natural resource", u"in ground"], "type": "emission"},
         {"categories": ("resource", "all around"), "type": "emission"},
     ]
     self.assertEqual(expected, normalize_biosphere_categories(ds))
Esempio n. 6
0
 def test_ds(self):
     ds = [{
         'categories': ('resource', 'in ground'),
         'type': 'emission'
     }, {
         'categories': ('resource', 'all around'),
         'type': 'emission'
     }]
     expected = [{
         'categories': [u'natural resource', u'in ground'],
         'type': 'emission'
     }, {
         'categories': ('resource', 'all around'),
         'type': 'emission'
     }]
     self.assertEqual(expected, normalize_biosphere_categories(ds))
Esempio n. 7
0
 def test_exc_no_categories(self):
     ds = [{"exchanges": [{"name": "foo"}]}]
     self.assertEqual(ds, normalize_biosphere_categories(copy.deepcopy(ds)))
Esempio n. 8
0
 def test_ds_wrong_type(self):
     ds = [{"categories": ("resource", "in ground"), "type": "process"}]
     self.assertEqual(ds, normalize_biosphere_categories(copy.deepcopy(ds)))