Skip to content

Piero Bosio Social Web Site Personale Logo Fediverso

Social Forum federato con il resto del mondo. Non contano le istanze, contano le persone

Non è assurdo che alla fine E' STATA LEI a decidere di non farsi più sentire?

Uncategorized
26 9 38

Gli ultimi otto messaggi ricevuti dalla Federazione
Post suggeriti
  • 0 Votes
    1 Posts
    0 Views
    I have a question about Python libraries and testing scope.If I'm importing 'serial' in my library, and use it like the following to create a connection to a sensor:--- start code ---import serialclass Sensor: def __init__(self, serial_device): self.__serial_device = serial_device try: self.__connection = serial.Serial( port=serial_device, baudrate=9600, bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, ) except serial.SerialException: print("Could not establish serial connection to sensor")--- end code ---how much testing should I do around the serial connection? Just mock up a few buffers (byte streams), and see how my class handles unexpected input?One the one hand, I want to make the library as solid as possible. On the other hand, I don't want to run tests on code I don't control (the library module). I know of the 'mock-serial' utility, but haven't used it.The aim is to make a Python version of my Arduino library for the CozIR Ambient CO2 sensor:https://codeberg.org/mjack/ambientCO2/src/branch/develop#python #unittest #testing #sensors
  • @maschinist Nice!

    Uncategorized
    1
    0 Votes
    1 Posts
    0 Views
    @maschinist Nice!Falls du Lust hast, kannst du es auch sehr gerne als Snippet hinzufügen: https://github.com/Automattic/wordpress-activitypub/tree/trunk/snippets
  • Ci sono esperte di esercizio fisico all'ascolto?

    Uncategorized
    8
    0 Votes
    8 Posts
    3 Views
    @gecco Qui a Milano è un po' un casino, purtroppo.
  • 0 Votes
    2 Posts
    0 Views
    @stefano Great song by a great #Cuban #jazz #band.My cousin, a professional drummer, introduced me to them decades ago. This album lives permanently in my CD player. My wife and I start our Sundays to it.