9 PKG =
'phm_reliability_calculation' 10 NAME =
'test_class_reliability_calculation' 21 selected_reliability_model =
"Exponential Distribution" 22 selected_reliability_unit =
False 25 result = self.rc.reliability_calculate_func(self.
usage_time, self.
failure_rate, selected_reliability_model, selected_reliability_unit, shape_parameter)
26 test_result = 0.951229424500714
30 self.assertAlmostEqual(result, test_result, 5)
34 selected_reliability_model =
"Exponential Distribution" 35 selected_reliability_unit =
True 38 result = self.rc.reliability_calculate_func(self.
usage_time, self.
failure_rate, selected_reliability_model, selected_reliability_unit, shape_parameter)
39 test_result = 0.9999861112075613
43 self.assertAlmostEqual(result, test_result, 5)
47 selected_reliability_model =
"Rayleigh Distribution" 48 selected_reliability_unit =
False 51 result = self.rc.reliability_calculate_func(self.
usage_time, self.
failure_rate, selected_reliability_model, selected_reliability_unit, shape_parameter)
56 self.assertAlmostEqual(result, test_result, 5)
60 selected_reliability_model =
"Rayleigh Distribution" 61 selected_reliability_unit =
True 64 result = self.rc.reliability_calculate_func(self.
usage_time, self.
failure_rate, selected_reliability_model, selected_reliability_unit, shape_parameter)
69 self.assertAlmostEqual(result, test_result, 5)
73 selected_reliability_model =
"Weibull Distribution" 74 selected_reliability_unit =
False 77 result = self.rc.reliability_calculate_func(self.
usage_time, self.
failure_rate, selected_reliability_model, selected_reliability_unit, shape_parameter)
82 self.assertAlmostEqual(result, test_result, 5)
86 selected_reliability_model =
"Weibull Distribution" 87 selected_reliability_unit =
True 90 result = self.rc.reliability_calculate_func(self.
usage_time, self.
failure_rate, selected_reliability_model, selected_reliability_unit, shape_parameter)
95 self.assertAlmostEqual(result, test_result, 5)
99 selected_reliability_model =
"Curve Distribution" 100 selected_reliability_unit =
False 101 shape_parameter = 1.5
103 result = self.rc.reliability_calculate_func(self.
usage_time, self.
failure_rate, selected_reliability_model, selected_reliability_unit, shape_parameter)
104 test_result = 0.9888198936843544
108 self.assertAlmostEqual(result, test_result, 5)
112 selected_reliability_model =
"Curve Distribution" 113 selected_reliability_unit =
True 114 shape_parameter = 1.5
116 result = self.rc.reliability_calculate_func(self.
usage_time, self.
failure_rate, selected_reliability_model, selected_reliability_unit, shape_parameter)
117 test_result = 0.9999999482391673
121 self.assertAlmostEqual(result, test_result, 5)
125 selected_reliability_model =
"None" 126 selected_reliability_unit =
False 127 shape_parameter = 1.5
129 result = self.rc.reliability_calculate_func(self.
usage_time, self.
failure_rate, selected_reliability_model, selected_reliability_unit, shape_parameter)
132 self.assertAlmostEqual(result, test_result, 5)
135 if __name__ ==
'__main__':
136 rosunit.unitrun(PKG, NAME, TestReliabilityCalculation, sysargs =
"--cov", coverage_packages=[str(PKG)])
def test_8_reliability_calculate_func(self)
def test_2_reliability_calculate_func(self)
def test_6_reliability_calculate_func(self)
def test_9_reliability_calculate_func(self)
def test_7_reliability_calculate_func(self)
def test_5_reliability_calculate_func(self)
def test_1_reliability_calculate_func(self)
def test_3_reliability_calculate_func(self)
def test_4_reliability_calculate_func(self)