def test_comp_unit_non_existent(self): napi_mock = patch( 'globomap_driver_napi.driver.NetworkAPI.get_equipment').start() napi_mock.return_value = [] data = self._queue_message('tests/json/messages/queue/equipment.json') kind = Kind() res = kind.comp_unit(data[0]) self.assertEqual(res, False)
def test_comp_unit_non_existent(self): napi_mock = patch( 'globomap_driver_napi.driver.NetworkAPI.get_equipment').start() napi_mock.return_value = [] data = self._queue_message('tests/json/messages/queue/equipment.json') kind = Kind() res = kind.comp_unit(data[0]) self.assertEqual(res, False)
def test_comp_unit(self): self._mock_equipment() data = self._queue_message('tests/json/messages/queue/equipment.json') data_ret = self._update_message( 'tests/json/messages/updates/comp_unit.json') for i in range(3): kind = Kind() res = kind.comp_unit(data[i]) self.assertDictEqual(res, data_ret[i])
def test_comp_unit(self): self._mock_equipment() data = self._queue_message( 'tests/json/messages/queue/equipment.json') data_ret = self._update_message( 'tests/json/messages/updates/comp_unit.json') for i in range(3): kind = Kind() res = kind.comp_unit(data[i]) self.assertDictEqual(res, data_ret[i])