How to use _check_labels method in autotest

Best Python code snippet using autotest_python

concrete_processor.py

Source:concrete_processor.py Github

copy

Full Screen

...52 self._message['title'],53 )54 # Se la segnalazione consiste in una issue55 elif kind == 'issue' or 'issue-note':56 self._check_labels(self._message['labels'])57 return self._mongofacade.get_match_labels(58 users,59 self._message['project_id'],60 self._message['labels'],61 )62 else:63 raise NameError('Type doesn\'t exist')64 def _check_labels(self, labels: list):65 """Guarda se le label della segnalazione66 legate al progetto indicati esistono.67 Funzione ausiliaria per `_filter_user_by_project`.68 Lavora come RedmineProcessor._check_label69 :param labels: lista delle label della segnalazione70 """71 project = self._message['project_id']72 label_project = self._mongofacade.get_label_project(project)73 for label in labels:74 if label not in label_project:75 self._mongofacade.insert_label_by_project(project, label)76class RedmineProcessor(Processor):77 """78 Classe processore di Redmine79 """80 def _filter_users_by_topic(self, users: list, kind: str) -> list:81 """82 Cerca gli utenti disponibili nella data della notifica iscritti ai83 topic della segnalazione84 :param users: lista di utenti appartenenti al progetto della85 segnalazione e disponibili nel giorno della segnalazione86 :param kind: tipologia della segnalazione per redmine87 :return: lista di utenti iscritti a quel topic88 """89 # L'unico tipo di segnalazioni possono essere 'issue'90 if kind != 'issue':91 raise NameError('Type not exists')92 self._check_labels(self._message['labels'])93 return self._mongofacade.get_match_labels(94 users,95 self._message['project_id'],96 self._message['labels'],97 )98 def _check_labels(self, labels: list):99 """100 Guarda se le label della segnalazione legate al progetto indicati101 esistono102 :param labels: lista delle label della segnalazione103 """104 project = self._message['project_id']105 label_project = self._mongofacade.get_label_project(project)106 for label in labels:107 if label not in label_project:...

Full Screen

Full Screen

binary.py

Source:binary.py Github

copy

Full Screen

...40 integer-valued labels), a :class:`.DPTransformer` can be used (e.g. :class:`.IntToString`).41 """42 def __init__(self, *, epsilon, value0, value1):43 super().__init__(epsilon=epsilon, delta=0.0)44 self.value0, self.value1 = self._check_labels(value0, value1)45 @classmethod46 def _check_labels(cls, value0, value1):47 if not isinstance(value0, str) or not isinstance(value1, str):48 raise TypeError("Binary labels must be strings. Use a DPTransformer (e.g. transformers.IntToString) for "49 "non-string labels")50 if len(value0) * len(value1) == 0:51 raise ValueError("Binary labels must be non-empty strings")52 if value0 == value1:53 raise ValueError("Binary labels must not match")54 return value0, value155 def _check_all(self, value):56 super()._check_all(value)57 self._check_labels(self.value0, self.value1)58 if not isinstance(value, str):59 raise TypeError("Value to be randomised must be a string")60 if value not in [self.value0, self.value1]:61 raise ValueError("Value to be randomised is not in the domain {\"%s\", \"%s\"}, got \"%s\"" %62 (self.value0, self.value1, value))63 return True64 @copy_docstring(DPMechanism.bias)65 def bias(self, value):66 raise NotImplementedError67 @copy_docstring(DPMechanism.variance)68 def variance(self, value):69 raise NotImplementedError70 def randomise(self, value):71 """Randomise `value` with the mechanism....

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run autotest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful