def setUp(self): self.tender_id = uuid.uuid4().hex self.award_id = uuid.uuid4().hex self.qualification_id = uuid.uuid4().hex self.document_id = generate_doc_id() self.process_tracker = ProcessTracker(db=MagicMock()) self.process_tracker.set_item(self.tender_id, self.award_id, 1) self.upload_to_tender_queue = Queue(10) self.url = 'http://127.0.0.1:20604' self.sleep_change_value = APIRateController() self.data = Data(self.tender_id, self.award_id, '12345678', 'awards', { 'meta': { 'id': self.document_id }, 'test_data': 'test_data' }) self.qualification_data = Data(self.tender_id, self.qualification_id, '12345678', 'qualifications', { 'meta': { 'id': self.document_id }, 'test_data': 'test_data' }) self.client = MagicMock() self.worker = UploadFileToTender(self.client, self.upload_to_tender_queue, self.process_tracker, MagicMock(), self.sleep_change_value) self.worker.retry_upload_to_tender_queue = Queue(10)
def setUp(self): super(EndToEndTest, self).setUp() self.filtered_tender_ids_queue = Queue(10) self.edrpou_codes_queue = Queue(10) self.process_tracker = ProcessTracker() self.tender_id = uuid.uuid4().hex self.sleep_change_value = APIRateController() self.worker = EdrDataBridge(config)
def setUp(self): self.process_tracker = ProcessTracker( MagicMock(has=MagicMock(return_value=False))) self.tenders_id = [uuid.uuid4().hex for _ in range(4)] self.sleep_change_value = APIRateController() self.client = MagicMock() self.tender_queue = Queue(10) self.sna = event.Event() self.sna.set() self.worker = Scanner.spawn(self.client, self.tender_queue, self.sna, self.process_tracker, self.sleep_change_value)
def setUp(self): self.tender_id = uuid.uuid4().hex self.award_id = uuid.uuid4().hex self.qualification_id = uuid.uuid4().hex self.document_id = generate_doc_id() self.process_tracker = ProcessTracker(db=MagicMock()) self.process_tracker.set_item(self.tender_id, self.award_id, 1) self.upload_to_doc_service_queue = Queue(10) self.upload_to_tender_queue = Queue(10) self.sleep_change_value = APIRateController() self.sna = event.Event() self.sna.set() self.tender_data = Data(self.tender_id, self.award_id, '12345678', 'awards', { 'meta': { 'id': self.document_id }, 'test_data': 'test_data' }) self.data = ({ 'meta': { 'id': self.document_id }, 'test_data': 'test_data' }, [self.tender_data]) self.qualification_data = Data(self.tender_id, self.qualification_id, '12345678', 'qualifications', { 'meta': { 'id': self.document_id }, 'test_data': 'test_data' }) self.doc_service_client = DocServiceClient(host='127.0.0.1', port='80', user='', password='') self.worker = UploadFileToDocService(self.upload_to_doc_service_queue, self.upload_to_tender_queue, self.process_tracker, self.doc_service_client, self.sna, self.sleep_change_value) self.url = '{url}'.format(url=self.doc_service_client.url)
def setUp(self): self.filtered_tender_ids_queue = Queue(10) self.edrpou_codes_queue = Queue(10) self.process_tracker = ProcessTracker() self.tender_id = uuid.uuid4().hex self.filtered_tender_ids_queue.put(self.tender_id) self.sleep_change_value = APIRateController() self.client = MagicMock() self.sna = event.Event() self.sna.set() self.worker = FilterTenders.spawn(self.client, self.filtered_tender_ids_queue, self.edrpou_codes_queue, self.process_tracker, self.sna, self.sleep_change_value) self.bid_ids = [uuid.uuid4().hex for _ in range(5)] self.qualification_ids = [uuid.uuid4().hex for _ in range(5)] self.award_ids = [uuid.uuid4().hex for _ in range(5)] self.request_ids = [generate_request_id() for _ in range(2)] self.response = ResponseMock({'X-Request-ID': self.request_ids[0]}, munchify({'prev_page': {'offset': '123'}, 'next_page': {'offset': '1234'}, 'data': {'status': tender_status, 'id': self.tender_id, 'procurementMethodType': 'aboveThresholdEU', 'awards': [self.awards(0, 0, AWARD_STATUS, CODES[0])]}}))
def setUp(self): self.process_tracker = ProcessTracker(self.db) self.tender_id = "111" self.award_id = "222" self.document_id = "333"