def __init__(self, db_path, index_path, xml_libraries=None): self.queue = ParsingQueue() self.data_parser = DataParser() self.index_path = index_path self.db_path = db_path self.xml_libraries = xml_libraries self.library_alias = []
def setUp(self): self.queue = ParsingQueue() self.expected = OrderedDict() self.not_scanned = {'scanned': False} self.lib = {'type': 'library'} self.test = {'type': 'test_suite'} self.none = {'type': None} self.resource = {'type': 'resource'} self.no_args = {'args': None}
def test_errors(self): queue = ParsingQueue() self.assertEqual(queue.get(), {}) with self.assertRaises(ValueError): queue.add('BuiltIn', 'invalid', None) with self.assertRaises(KeyError): queue.set('NotHere') with self.assertRaises(TypeError): queue.add('BuiltIn', 'library')