def test_compare(self):
        print("단위간 비교")
        len1 = measurement.Length(10.0,'m')
        len2 = measurement.Length(6,'m')
        ma1 = measurement.Mass(10.0,'kg')
        ma2 = measurement.Mass(5,'kg')

        self.assertFalse(measurement.compare_unit(len1,ma1),"len1과 ma1의 단위는 서로 다름")
        print("-------------")
 def test_volume(self):
     len1= measurement.Length(10,'m')
     vol1 = measurement.Volume()
     print(vol1.get())
     vol2= measurement.Volume(10,'m^3')
     vol3.get_square_volume(len1)
Exemple #3
0
 def __init__(self,x_f= meas.Length(0.0,'m')):
     self.position_x= x_f       #x축(1차원계)상에서의 위치 객체 생성
 def test_Length(self):
     print("길이 객체 생성")
     len1 = measurement.Length()
     len1.set(10.0)
     self.assertEqual(10.0,len1.get(),"결과정상")
     print("-------------")
Exemple #5
0
 def __init__(self, x, y):
     self.x = measure.Length(x)
     self.y = measure.Length(y)
     self.r = math.sqrt(self.x.get()**2 + self.y.get()**2)
     self.theta = measure.Degree(math.degrees(math.atan2(y, x)), 'deg')