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(), [])
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(), [])
def extra_setup(self): mocks.__init__()