def test_debug_run_with_no_return(self, runcall): section = Section('name') section.append(Setting('debug_bears', 'True')) my_bear = Bear(section, self.queue) args = () kwargs = {} self.assertIsNone(my_bear.run_bear_from_section(args, kwargs))
def __init__(self, file_dict, # filename : file contents section, message_queue, timeout=0): Bear.__init__(self, section, message_queue, timeout) self.file_dict = file_dict
def __init__(self, file_dict, # filename : file contents section, message_queue, TIMEOUT=0): Bear.__init__(self, section, message_queue, TIMEOUT) self.file_dict = file_dict
def test_simple_api(self): self.assertRaises(TypeError, TestBear, self.settings, 2) self.assertRaises(TypeError, TestBear, None, self.queue) self.assertRaises(NotImplementedError, self.uut.kind) base = Bear(self.settings, None) self.assertRaises(NotImplementedError, base.run) self.assertEqual(base.get_non_optional_settings(), {})
def test_dependencies(self): self.assertEqual(Bear.get_dependencies(), []) self.assertEqual(Bear.missing_dependencies([]), []) self.assertEqual(Bear.missing_dependencies([BadTestBear]), []) self.assertEqual(TestBear.missing_dependencies([]), [BadTestBear]) self.assertEqual(TestBear.missing_dependencies([BadTestBear]), []) self.assertEqual(TestBear.missing_dependencies([TestBear]), [BadTestBear]) self.assertEqual(TestBear.missing_dependencies([TestBear, BadTestBear]), [])
def test_dependencies(self): self.assertEqual(Bear.BEAR_DEPS, set()) self.assertEqual(Bear.missing_dependencies([]), set()) self.assertEqual(Bear.missing_dependencies([BadTestBear]), set()) self.assertEqual(TestBear.missing_dependencies([]), {BadTestBear}) self.assertEqual(TestBear.missing_dependencies([BadTestBear]), set()) self.assertEqual(TestBear.missing_dependencies([TestBear]), {BadTestBear}) self.assertEqual(TestBear.missing_dependencies([TestBear, BadTestBear]), set())
def __init__(self, file_dict, section, message_queue, timeout=0): """ Constructs a new GlobalBear. :param file_dict: The dictionary of {filename: file contents}. See :class:`coalib.bears.Bear` for other parameters. """ Bear.__init__(self, section, message_queue, timeout) self.file_dict = file_dict
def test_methods_available(self): # these should be available and not throw anything base = Bear(self.settings, None) base.set_up() base.tear_down() self.assertRaises(NotImplementedError, base.run) self.assertEqual(base.get_non_optional_settings(), {})
def test_new_result(self): bear = Bear(self.settings, None) result = bear.new_result('test message', '/tmp/testy') expected = Result.from_values(bear, 'test message', '/tmp/testy') self.assertEqual(result, expected)
def __init__(self, section, message_queue, TIMEOUT=0): Bear.__init__(self, section, message_queue, TIMEOUT)
def __init__(self, section, queue, error_message): Bear.__init__(self, section, queue) self.error_message = error_message
def __init__(self, section, queue, timeout=0.1): Bear.__init__(self, section, queue, timeout)
def __init__(self, section, queue): Bear.__init__(self, section, queue)
def __init__(self): Bear.__init__(self, Section("settings"), multiprocessing.Queue())
def __init__(self, section, queue): Bear.__init__(self, section, queue) self.was_executed = False
def test_custom_continue(self, do_continue): section = Section('name') bear = Bear(section, self.queue, debugger=True) args = () self.assertEqual(Debugger(bear).do_quit(args), 1) pdb.Pdb.do_continue.assert_called_once_with(args)
def __init__(self, *args, **kwargs): Bear.__init__(self, *args, **kwargs)
def test_debug_run_with_no_return(self, runcall): section = Section('name') my_bear = Bear(section, self.queue, debugger=True) args = () kwargs = {} self.assertIsNone(my_bear.run_bear_from_section(args, kwargs))
def __init__(self, section, queue, prerequisites_fulfilled): BearWithPrerequisites.prerequisites_fulfilled = prerequisites_fulfilled Bear.__init__(self, section, queue) self.was_executed = False
def __init__(self, section, message_queue, timeout=0): Bear.__init__(self, section, message_queue, timeout)