Beispiel #1
0
    def test_clone(self):
        original = LatentSegment.new(400, 100, 100)
        clone = original.clone()
        self.assertEqual(original, clone)
        self.assertIsNot(original, clone)

        original = LatentSegment.new(-500, 0, 0, 10)
        clone = original.clone()
        self.assertEqual(original, clone)
        self.assertIsNot(original, clone)
Beispiel #2
0
 def test_new_different_temps(self):
     with self.assertRaises(ValueError):
         LatentSegment.new(400, 100, 150)
     with self.assertRaises(ValueError):
         LatentSegment.new(-500, 0, -50, 10)
Beispiel #3
0
 def test_new_equal_temps(self):
     self.assertEqual(LatentSegment.new(400, 100, 100),
                      LatentSegment(400, 100, None))
     self.assertEqual(LatentSegment.new(-500, 0, 0, 10),
                      LatentSegment(-500, 0, 10))