예제 #1
0
class TestPMTReplugger(TestCase):

    def setUp(self):
        self.replugger = PMTReplugger(PMT_COMBS, ANGLES, [])

    def test_angle_for(self):
        #self.assertEqual(0, self.replugger.angle_for((0, 1)))
        #self.assertEqual(1, self.replugger.angle_for((0, 2)))
        pass

    def test_switch(self):
        self.replugger.switch([0, 1], [1, 0])
        self.assertEqual(self.replugger._new_combs,
                         [(0, 1), (1, 2), (1, 3), (0, 2), (0, 3), (2, 3)])

    def test_switch_three_indicies(self):
        self.replugger.switch([0, 1, 2], [1, 2, 0])
        self.assertEqual(self.replugger._new_combs,
                         [(1, 2), (0, 1), (1, 3), (0, 2), (2, 3), (0, 3)])

    def test_angle_is_correct_if_two_pmts_are_switched(self):
        self.replugger.switch([0, 1], [1, 0])
        self.assertEqual(0, self.replugger.angle_for((0, 1)))
        self.assertEqual(3, self.replugger.angle_for((0, 2)))
        self.assertEqual(4, self.replugger.angle_for((0, 3)))

    def test_angles_are_ordered_correctly_after_switch(self):
        self.replugger.switch([0, 1, 2], [1, 2, 0])
        self.assertListEqual([1, 3, 5, 0, 2, 4], self.replugger.angles)
예제 #2
0
 def setUp(self):
     self.replugger = PMTReplugger(PMT_COMBS, ANGLES, [])