def test_that_detector_ids_cannot_be_set_as_string(self):
        group = MuonGroup(group_name="group1")

        with self.assertRaises(AttributeError):
            group.detectors = "1"
            group.detectors = "[1]"
            group.detectors = "1,2"
Beispiel #2
0
    def test_that_detector_ids_cannot_be_set_as_string(self):
        group = MuonGroup(group_name="group1")

        with self.assertRaises(AttributeError):
            group.detectors = "1"
            group.detectors = "[1]"
            group.detectors = "1,2"
Beispiel #3
0
    def test_that_can_have_group_with_no_detectors(self):
        group = MuonGroup(group_name="group1")

        group.detectors = []

        self.assertEqual(group.detectors, [])
        self.assertEqual(group.n_detectors, 0)
    def test_that_can_have_group_with_no_detectors(self):
        group = MuonGroup(group_name="group1")

        group.detectors = []

        self.assertEqual(group.detectors, [])
        self.assertEqual(group.n_detectors, 0)
Beispiel #5
0
    def test_that_number_of_detectors_is_correct(self):
        group = MuonGroup(group_name="group1")

        group.detectors = [1, 1, 2, 2, 3, 3, 4, 4, 5, 5]

        self.assertEqual(group.n_detectors, 5)
Beispiel #6
0
    def test_that_duplicated_detectors_are_removed(self):
        group = MuonGroup(group_name="group1")

        group.detectors = [1, 1, 2, 2, 3, 3, 4, 4, 5, 5]

        self.assertEqual(group.detectors, [1, 2, 3, 4, 5])
Beispiel #7
0
    def test_that_detectors_always_in_ascending_order(self):
        group = MuonGroup(group_name="group1")

        group.detectors = [5, 4, 3, 2, 1]

        self.assertEqual(group.detectors, [1, 2, 3, 4, 5])
Beispiel #8
0
    def test_that_detectors_set_as_list_of_ints_is_set_correctly(self):
        group = MuonGroup(group_name="group1")

        group.detectors = [1, 2, 3, 4, 5]

        self.assertEqual(group.detectors, [1, 2, 3, 4, 5])
    def test_that_number_of_detectors_is_correct(self):
        group = MuonGroup(group_name="group1")

        group.detectors = [1, 1, 2, 2, 3, 3, 4, 4, 5, 5]

        self.assertEqual(group.n_detectors, 5)
Beispiel #10
0
    def test_that_duplicated_detectors_are_removed(self):
        group = MuonGroup(group_name="group1")

        group.detectors = [1, 1, 2, 2, 3, 3, 4, 4, 5, 5]

        self.assertEqual(group.detectors, [1, 2, 3, 4, 5])
Beispiel #11
0
    def test_that_detectors_always_in_ascending_order(self):
        group = MuonGroup(group_name="group1")

        group.detectors = [5, 4, 3, 2, 1]

        self.assertEqual(group.detectors, [1, 2, 3, 4, 5])
Beispiel #12
0
    def test_that_detectors_set_as_list_of_ints_is_set_correctly(self):
        group = MuonGroup(group_name="group1")

        group.detectors = [1, 2, 3, 4, 5]

        self.assertEqual(group.detectors, [1, 2, 3, 4, 5])