Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cuando ruedas enteras del contador con lectura 0 el fake devolvia non… #133

Merged
merged 1 commit into from
Jul 22, 2020

Conversation

polsala
Copy link
Member

@polsala polsala commented Jul 22, 2020

Solucionar problemas con las lecturas fake:

  • Al crear las lecturas e integrador Fake hay un problema con los nuevos getters, ya quela mayoria la condicion es if X devuelve, pero el problema estava cuando un valor era 0 ya que directamente se saltaba la condicion hacia un return None lo que al mismo tiempo hace que los nuevos datos se seten mal y realize mal calculos como el giro de contador

Este F1 tenia una lectura y ha creado una fake, _numero_ruedas_enteras del integrador fake se ha seteado con None ya que el getter del contador con lecturas tenia como ruedas enteras 0.0 y su getter devolvia None

{'_lectura_hasta': None, '_magnitud': None, '_ajuste': None, '_periode': None, '_numero_ruedas_enteras': None, 'integrador': <Element {http://localhost/elegibilidad}Integrador at 0x7f404a776ab8>, 'comptador': None, '_lectura_desde': None}
{'_lectura_hasta': <gestionatr.input.messages.F1.Lectura object at 0x7f403a632390>, '_magnitud': 'AS', '_ajuste': None, '_periode': '10', '_numero_ruedas_enteras': 0.0, 'integrador': None, 'comptador': None, '_lectura_desde': <gestionatr.input.messages.F1.Lectura object at 0x7f403a632d50>}

entonces al ir a calcular el giro:

fake.gir_comptador

TypeError Traceback (most recent call last)
in ()
----> 1 fake.gir_comptador

/home/psala/.virtualenvs/erp/local/lib/python2.7/site-packages/gestionatr/input/messages/F1.pyc in gir_comptador(self)
989 if self.numero_ruedas_enteras == 99:
990 return 10
--> 991 return 10 ** self.numero_ruedas_enteras
992
993 @Property

TypeError: unsupported operand type(s) for ** or pow(): 'int' and 'NoneType'

@polsala polsala requested a review from a team July 22, 2020 09:29
@polsala polsala self-assigned this Jul 22, 2020
@polsala polsala added bug WIP Work in progress labels Jul 22, 2020
@polsala polsala added this to the v0.0.6 milestone Jul 22, 2020
@coveralls
Copy link

Coverage Status

Coverage remained the same at 78.07% when pulling 93de79f on check_bug_lectura_fake into 657eb99 on master.

@polsala polsala removed this from the v0.0.6 milestone Jul 22, 2020
@polsala polsala added To be merged and removed WIP Work in progress labels Jul 22, 2020
@guilleJB guilleJB merged commit 2798f08 into master Jul 22, 2020
@guilleJB guilleJB deleted the check_bug_lectura_fake branch July 22, 2020 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants