@ensure_empty_collections("groups")
    @clear_collections("groups")
    def test_create_batch_groups(self, groups=10):

        gids = []
        for i in range(groups):
            group = self.base_group.copy()
            group["group-name"] += str(i)
            gids.append(api.group.create_group_request(group, uid=self.owner_uid))

        assert len(api.team.get_groups(uid=self.owner_uid, tid=self.owner_tid)) \
            == len(gids), "Not all groups were created."

        with pytest.raises(InternalException):
            api.group.get_group(gid="Not a real gid")
            assert False, "Looked up group with invalid gid!"

        with pytest.raises(InternalException):
            api.group.get_group(name="Not a real name")
            assert False, "Looked up group with invalid name!"
type n: int
dataset/ETHPy150Open EasyCTF/easyctf-2015/api/tests/group_test.py/TestGroups.test_create_batch_groups--crossover with--dataset/ETHPy150Open kamyu104/LeetCode/Python/bulb-switcher.py/Solution.bulbSwitch