Ejemplo n.º 1
0
 def test_decomposed_uses_solver(self):
     test_data = {
         ("t", "1"): {
             'exchanges': [{
                 'amount': 0.5,
                 'input': ('t', "2"),
                 'type': 'technosphere',
                 'uncertainty type': 0
             }, {
                 'amount': 1,
                 'input': ('biosphere', "1"),
                 'type': 'biosphere',
                 'uncertainty type': 0
             }],
             'type':
             'process',
             'unit':
             'kg'
         },
         ("t", "2"): {
             'exchanges': [],
             'type': 'process',
             'unit': 'kg'
         },
     }
     self.add_basic_biosphere()
     test_db = Database("t")
     test_db.register()
     test_db.write(test_data)
     lca = LCA({("t", "1"): 1})
     lca.lci(factorize=True)
     # Indirect test because no easy way to test a function is called
     lca.technosphere_matrix = None
     self.assertEqual(float(lca.solve_linear_system().sum()), 1.5)
Ejemplo n.º 2
0
 def test_decomposed_uses_solver(self):
     test_data = {
         ("t", "1"): {
             "exchanges": [
                 {
                     "amount": 0.5,
                     "input": ("t", "2"),
                     "type": "technosphere",
                     "uncertainty type": 0,
                 },
                 {
                     "amount": 1,
                     "input": ("biosphere", "1"),
                     "type": "biosphere",
                     "uncertainty type": 0,
                 },
             ],
             "type":
             "process",
             "unit":
             "kg",
         },
         ("t", "2"): {
             "exchanges": [],
             "type": "process",
             "unit": "kg"
         },
     }
     self.add_basic_biosphere()
     test_db = Database("t")
     test_db.register()
     test_db.write(test_data)
     lca = LCA({("t", "1"): 1})
     lca.lci(factorize=True)
     # Indirect test because no easy way to test a function is called
     lca.technosphere_matrix = None
     self.assertEqual(float(lca.solve_linear_system().sum()), 1.5)