Ejemplo n.º 1
0
 def test_create_obj(self):
     mock_data = {
         'class': {
             'module': 'bw2io.tests',
             'name': 'MockDS'
         },
         'metadata': {
             'circle': 'square'
         },
         'data': [],
         'name': 'Wilhelm'
     }
     data = BW2Package._load_obj(mock_data)
     obj = BW2Package._create_obj(data)
     self.assertTrue(isinstance(obj, MockDS))
     self.assertTrue("Wilhelm" in mocks)
     self.assertEqual(mocks['Wilhelm'], {'circle': 'square'})
     mocks.__init__()
     self.assertEqual(mocks['Wilhelm'], {'circle': 'square'})
     self.assertEqual(MockDS("Wilhelm").load(), [])
Ejemplo n.º 2
0
 def test_create_obj(self):
     mock_data = {
         "class": {
             "module": "bw2io.tests",
             "name": "MockDS"
         },
         "metadata": {
             "circle": "square"
         },
         "data": [],
         "name": "Wilhelm",
     }
     data = BW2Package._load_obj(mock_data)
     obj = BW2Package._create_obj(data)
     self.assertTrue(isinstance(obj, MockDS))
     self.assertTrue("Wilhelm" in mocks)
     self.assertEqual(mocks["Wilhelm"], {"circle": "square"})
     mocks.__init__()
     self.assertEqual(mocks["Wilhelm"], {"circle": "square"})
     self.assertEqual(MockDS("Wilhelm").load(), [])