Beispiel #1
0
 def test_positive_base_negative_exponent(self):
     o_TestNumber    = Number(s_Input="5.43m")
     f_Expected      = 0.00543
     self.assertEqual(o_TestNumber.f_Value, f_Expected)
Beispiel #2
0
 def test_correct_damping_coefficient(self):
     o_TestFilter    = RCLowPass(s_Resistance="691.5G", s_Capacitance="14")
     f_Expected      = Number(s_Input="0.103p").f_Value
     self.assertEqual(o_TestFilter.f_DampingCoefficient, f_Expected)
Beispiel #3
0
 def test_correct_resonant_frequency(self):
     o_TestFilter    = RCLowPass(s_Resistance="691.5G", s_Capacitance="14")
     f_Expected      = Number(s_Input="0.103p").f_Value
     self.assertEqual(o_TestFilter.f_ResonantFrequency, f_Expected)
Beispiel #4
0
 def test_positive_base_positive_exponent(self):
     o_TestNumber    = Number(s_Input="10.4k")
     f_Expected      = 10400
     self.assertEqual(o_TestNumber.f_Value, f_Expected)
Beispiel #5
0
 def test_invalid_prefix(self):
     try:
         Number(s_Input='5424.524r')
     except Exception as e:
         self.assertEqual(type(e), ValueError)
Beispiel #6
0
 def test_unitless_string(self):
     o_TestNumber    = Number(s_Input="103.56")
     f_Expected      = 103.56
     self.assertEqual(o_TestNumber.f_Value, f_Expected)
Beispiel #7
0
 def test_negative_base_negative_exponent(self):
     o_TestNumber    = Number(s_Input="-11.27p")
     f_Expected      = -0.00000000001127
     self.assertEqual(o_TestNumber.f_Value, f_Expected)
Beispiel #8
0
 def test_negative_base_positive_exponent(self):
     o_TestNumber    = Number(s_Input="-4.19G")
     f_Expected      = -4190000000
     self.assertEqual(o_TestNumber.f_Value, f_Expected)