Lines Matching refs:validator

256             validator = check_init_priorities.Validator("path", "pickle", mock_log)
258 self.assertEqual(validator._obj, mock_obj)
264 validator = check_init_priorities.Validator("", "", None)
265 validator.log = mock.Mock()
267 validator._check_dep(123, 123)
269 self.assertFalse(validator.log.info.called)
270 self.assertFalse(validator.log.warning.called)
271 self.assertFalse(validator.log.error.called)
275 validator = check_init_priorities.Validator("", "", None)
276 validator.log = mock.Mock()
277 validator._obj = mock.Mock()
279 validator._ord2node = {1: mock.Mock(), 2: mock.Mock()}
280 validator._ord2node[1]._binding = None
281 validator._ord2node[2]._binding = None
283 validator._obj.devices = {1: (10, "i1")}
284 validator._check_dep(1, 2)
286 validator._obj.devices = {2: (20, "i2")}
287 validator._check_dep(1, 2)
289 self.assertFalse(validator.log.info.called)
290 self.assertFalse(validator.log.warning.called)
291 self.assertFalse(validator.log.error.called)
295 validator = check_init_priorities.Validator("", "", None)
296 validator.log = mock.Mock()
297 validator._obj = mock.Mock()
298 validator.errors = 0
300 validator._ord2node = {1: mock.Mock(), 2: mock.Mock()}
301 validator._ord2node[1]._binding = None
302 validator._ord2node[1].path = "/1"
303 validator._ord2node[2]._binding = None
304 validator._ord2node[2].path = "/2"
306 validator._obj.devices = {1: (10, "i1"), 2: (20, "i2")}
308 validator._check_dep(2, 1)
309 validator._check_dep(1, 2)
311 validator.log.info.assert_called_once_with("/2 <i2> 20 > /1 <i1> 10")
312 validator.log.error.assert_has_calls([
315 self.assertEqual(validator.errors, 1)
319 validator = check_init_priorities.Validator("", "", None)
320 validator.log = mock.Mock()
321 validator._obj = mock.Mock()
322 validator.errors = 0
324 validator._ord2node = {1: mock.Mock(), 2: mock.Mock()}
325 validator._ord2node[1]._binding = None
326 validator._ord2node[1].path = "/1"
327 validator._ord2node[2]._binding = None
328 validator._ord2node[2].path = "/2"
330 validator._obj.devices = {1: (10, "i1"), 2: (10, "i2")}
333 validator._check_dep(1, 2)
337 validator = check_init_priorities.Validator("", "", None)
338 validator.log = mock.Mock()
339 validator._obj = mock.Mock()
340 validator.errors = 0
346 validator._ord2node = {1: mock.Mock(), 3: mock.Mock()}
347 validator._ord2node[1]._binding.compatible = "compat-1"
348 validator._ord2node[1].path = "/1"
349 validator._ord2node[3]._binding.compatible = "compat-3"
350 validator._ord2node[3].path = "/3"
352 validator._obj.devices = {1: 20, 3: 10}
354 validator._check_dep(3, 1)
356 self.assertListEqual(validator.log.info.call_args_list, [
359 self.assertEqual(validator.errors, 0)
380 validator = check_init_priorities.Validator("", "", None)
381 validator._ord2node = {1: dev0, 2: dev1, 3: dev2}
382 validator._obj = mock.Mock()
383 validator._obj.devices = {1: 10, 2: 10, 3: 20}
385 validator.check_edt()