• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ByteOps-swe / MVP / 8215196951

09 Mar 2024 02:27PM UTC coverage: 9.381% (-61.8%) from 71.198%
8215196951

push

github

Shinji76
Merge branch 'develop' into Action-test

47 of 59 new or added lines in 6 files covered. (79.66%)

956 existing lines in 41 files now uncovered.

144 of 1535 relevant lines covered (9.38%)

0.09 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/PythonSensorsSimulator/Model/Simulators/ElectricalFaultSimulator.py
UNCOV
1
import random
×
UNCOV
2
from .Simulator import Simulator
×
UNCOV
3
from .SensorTypes import SensorTypes
×
4

UNCOV
5
class ElectricalFaultSimulator(Simulator):
×
UNCOV
6
    __count = 0
×
7

UNCOV
8
    def __init__(self, latitude: float, longitude: float, cella: str = "Centro", initial_value=0):
×
UNCOV
9
        ElectricalFaultSimulator.__count += 1
×
UNCOV
10
        self._fault_probability = 0.1
×
UNCOV
11
        super().__init__(latitude, longitude, cella,
×
12
                         f"GstE{ElectricalFaultSimulator.__count}",initial_value, SensorTypes.ELECTRICAL_FAULT.value)
13

UNCOV
14
    def _generate_measure(self) -> None:
×
UNCOV
15
        if self._misurazione == 1:
×
16
            self._fault_probability = min(0.9, self._fault_probability + 0.1)
×
17
        else:
UNCOV
18
            self._fault_probability = max(0.1, self._fault_probability - 0.1)
×
UNCOV
19
        self._misurazione = 1 if random.random() < self._fault_probability else 0
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc