Пример #1
0
class TestTrack(TestCase):
    def setUp(self):
        self.track = Track((1, 2, 3, 4, 0, 0, 1, 8, 9, 'a', 'b', 'c'),
                           zed_correction=0)

    def test_track_init(self):
        track = self.track
        self.assertEqual(1, track.id)
        self.assertListEqual([2, 3, 4], list(track.pos))
        self.assertListEqual([0, 0, 1], list(track.dir))
        self.assertEqual(8, track.E)
        self.assertEqual(9, track.time)
        self.assertTupleEqual(('a', 'b', 'c'), track.args)

    def test_track_repr(self):
        repr_str = ("Track:\n id: 1\n pos: [2 3 4]\n dir: (0.0, 0.0, 1.0)\n"
                    " energy: 8 GeV\n time: 9 ns\n")
        self.assertEqual(repr_str, self.track.__repr__())
Пример #2
0
 def setUp(self):
     self.track = Track((1, 2, 3, 4, 0, 0, 1, 8, 9, 'a', 'b', 'c'),
                        zed_correction=0)