def test_lowhash(self): '''test low hash condition''' params = RuleParameters(self.miner.minerinfo.miner_type, 10000, 40, 55, 60*10) rules = MinerStatisticsRule(self.miner, self.minerstats, params) isbroken = rules.isbroken() self.assertTrue(isbroken) self.assertTrue(len(rules.brokenrules) > 0)
def test_hardware_errors_alert(self): '''test when hardware errors exceeced''' self.minerstats.hardware_errors = 100 params = RuleParameters(self.miner.minerinfo.miner_type, 13500, 40, 55, 60*10, None, 99, '10s') rules = MinerStatisticsRule(self.miner, self.minerstats, params) isbroken = rules.isbroken() self.assertTrue(isbroken) self.assertTrue(len(rules.brokenrules) > 0)
def test_low_temp(self): '''test when temp is low on miner''' self.minerstats.controllertemp = 101 params = RuleParameters(self.miner.minerinfo.miner_type, 10000, 40, 55, 60*10) rules = MinerStatisticsRule(self.miner, self.minerstats, params) isbroken = rules.isbroken() self.assertTrue(isbroken) self.assertTrue(len(rules.brokenrules) > 0)
def test_high_temp_reset_null(self): '''test when controller temp is high on miner. no reset''' self.minerstats.controllertemp = 101 params = RuleParameters(self.miner.minerinfo.miner_type, 10000, 40, 55, 60*10, maxtempreset=None) rules = MinerStatisticsRule(self.miner, self.minerstats, params) isbroken = rules.isbroken() self.assertTrue(isbroken) self.assertFalse(rules.has_reboot_rule())
def test_board_high_temp_reset(self): '''test when controller temp is high on miner''' self.minerstats.tempboard1 = 150 self.minerstats.elapsed = (60 * 10) + 1 params = RuleParameters(self.miner.minerinfo.miner_type, 10000, 40, 55, 60*10, maxtempreset=120) rules = MinerStatisticsRule(self.miner, self.minerstats, params) isbroken = rules.isbroken() self.assertTrue(isbroken) self.assertTrue(rules.has_reboot_rule())
def test_string_has_reading(self): params = RuleParameters(self.miner.minerinfo.miner_type, 10000, '', 55, 60 * 10) rules = MinerStatisticsRule(self.miner, self.minerstats, params) self.assertFalse(rules.hasreading_num(params.controllertemplimit))
def test_incompatable_minertype(self): params = RuleParameters('notthesameminertype', 10000, 40, 55, 60*10) rules = MinerStatisticsRule(self.miner, self.minerstats, params) isbroken = rules.isbroken() self.assertFalse(isbroken)
def test_float_has_reading(self): params = RuleParameters(self.miner.minerinfo.miner_type, 10000, 49.9, 55, 60*10) self.assertTrue(MinerStatisticsRule.hasreading_num(params.controllertemplimit))