def test_check_group(self):
        tree = loads("({A},({B},{C}){B C},{D}){A B C D};")

        try:
            PhyTree._check_group(tree[0])
        except ValueError:
            raise AssertionError()
    def test_check_group_fails(self):
        bad_groups = [
            "({A},{A B}){A B};", "({A},{B},{C}){A B};", "({A},{B}){A B C};",
            "({A},{A},{B}){A B};"
            "{A};"
        ]

        for t in bad_groups:
            with self.assertRaises(ValueError):
                PhyTree._check_group(loads(t)[0])