repo_id stringclasses 400
values | commit_sha stringclasses 400
values | commit_index int32 0 951 | in_repo_split stringclasses 1
value | cross_repo_split stringclasses 1
value | test_file stringlengths 7 121 | test_function stringlengths 1 108 | assertion_type stringclasses 32
values | difficulty stringclasses 8
values | context_lines int32 3 600 | prefix large_stringlengths 44 113k | target large_stringlengths 1 498 | anchor_sha stringclasses 400
values | anchor_index int32 0 951 | qna_source stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
geopy/geopy | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | train | train | test/test_location.py | _location_properties_test | self.assertEqual | variable | 39 | import pickle
import unittest
from geopy.location import Location
from geopy.point import Point
GRAND_CENTRAL_STR = "89 E 42nd St New York, NY 10017"
GRAND_CENTRAL_COORDS_STR = "40.752662,-73.9773"
GRAND_CENTRAL_COORDS_TUPLE = (40.752662, -73.9773, 0)
GRAND_CENTRAL_POINT = Point(GRAND_CENTRAL_COORDS_STR)
GRAND_CENT... | GRAND_CENTRAL_STR) | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | v2_extractor_at_anchor |
geopy/geopy | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | train | train | test/test_location.py | test_location_str | self.assertEqual | variable | 49 | import pickle
import unittest
from geopy.location import Location
from geopy.point import Point
GRAND_CENTRAL_STR = "89 E 42nd St New York, NY 10017"
GRAND_CENTRAL_COORDS_STR = "40.752662,-73.9773"
GRAND_CENTRAL_COORDS_TUPLE = (40.752662, -73.9773, 0)
GRAND_CENTRAL_POINT = Point(GRAND_CENTRAL_COORDS_STR)
GRAND_CENT... | GRAND_CENTRAL_POINT) | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | v2_extractor_at_anchor |
geopy/geopy | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | train | train | test/test_location.py | _location_properties_test | self.assertEqual | complex_expr | 40 | import pickle
import unittest
from geopy.location import Location
from geopy.point import Point
GRAND_CENTRAL_STR = "89 E 42nd St New York, NY 10017"
GRAND_CENTRAL_COORDS_STR = "40.752662,-73.9773"
GRAND_CENTRAL_COORDS_TUPLE = (40.752662, -73.9773, 0)
GRAND_CENTRAL_POINT = Point(GRAND_CENTRAL_COORDS_STR)
GRAND_CENT... | GRAND_CENTRAL_COORDS_TUPLE[0]) | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | v2_extractor_at_anchor |
geopy/geopy | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | train | train | test/test_location.py | _location_properties_test | self.assertEqual | complex_expr | 41 | import pickle
import unittest
from geopy.location import Location
from geopy.point import Point
GRAND_CENTRAL_STR = "89 E 42nd St New York, NY 10017"
GRAND_CENTRAL_COORDS_STR = "40.752662,-73.9773"
GRAND_CENTRAL_COORDS_TUPLE = (40.752662, -73.9773, 0)
GRAND_CENTRAL_POINT = Point(GRAND_CENTRAL_COORDS_STR)
GRAND_CENT... | GRAND_CENTRAL_COORDS_TUPLE[1]) | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | v2_extractor_at_anchor |
geopy/geopy | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | train | train | test/test_location.py | _location_properties_test | self.assertEqual | complex_expr | 42 | import pickle
import unittest
from geopy.location import Location
from geopy.point import Point
GRAND_CENTRAL_STR = "89 E 42nd St New York, NY 10017"
GRAND_CENTRAL_COORDS_STR = "40.752662,-73.9773"
GRAND_CENTRAL_COORDS_TUPLE = (40.752662, -73.9773, 0)
GRAND_CENTRAL_POINT = Point(GRAND_CENTRAL_COORDS_STR)
GRAND_CENT... | GRAND_CENTRAL_COORDS_TUPLE[2]) | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | v2_extractor_at_anchor |
geopy/geopy | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | train | train | test/test_point.py | test_point_str_deg | self.assertEqual | numeric_literal | 20 | import math
import pickle
import sys
import unittest
import warnings
from geopy.point import Point
class PointTestCase(unittest.TestCase):
lat = 40.74113
lon = -73.989656
alt = 3
coords = (lat, lon, alt)
def test_point_str_deg(self):
point = Point("UT: N 39\xb020' 0'' / W 74\xb035' 0''")
... | 0) | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | v2_extractor_at_anchor |
geopy/geopy | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | train | train | test/test_point.py | test_point_degrees_are_normalized | self.assertEqual | func_call | 22 | import math
import pickle
import sys
import unittest
import warnings
from geopy.point import Point
class PointTestCase(unittest.TestCase):
lat = 40.74113
lon = -73.989656
alt = 3
coords = (lat, lon, alt)
def test_point_degrees_are_normalized(self):
with warnings.catch_warnings(record=True... | len(w)) | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | v2_extractor_at_anchor |
geopy/geopy | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | train | train | test/test_point.py | test_point_float | self.assertEqual | complex_expr | 18 | import math
import pickle
import sys
import unittest
import warnings
from geopy.point import Point
class PointTestCase(unittest.TestCase):
lat = 40.74113
lon = -73.989656
alt = 3
coords = (lat, lon, alt)
def test_point_float(self):
point = Point(self.lat, self.lon, self.alt)
self... | self.lon) | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | v2_extractor_at_anchor |
geopy/geopy | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | train | train | test/test_point.py | test_point_float | self.assertEqual | complex_expr | 19 | import math
import pickle
import sys
import unittest
import warnings
from geopy.point import Point
class PointTestCase(unittest.TestCase):
lat = 40.74113
lon = -73.989656
alt = 3
coords = (lat, lon, alt)
def test_point_float(self):
point = Point(self.lat, self.lon, self.alt)
self.... | self.lat) | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | v2_extractor_at_anchor |
geopy/geopy | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | train | train | test/test_point.py | test_point_float | self.assertEqual | complex_expr | 20 | import math
import pickle
import sys
import unittest
import warnings
from geopy.point import Point
class PointTestCase(unittest.TestCase):
lat = 40.74113
lon = -73.989656
alt = 3
coords = (lat, lon, alt)
def test_point_float(self):
point = Point(self.lat, self.lon, self.alt)
self.... | self.alt) | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | v2_extractor_at_anchor |
geopy/geopy | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | train | train | test/test_point.py | test_point_slices | self.assertEqual | complex_expr | 21 | import math
import pickle
import sys
import unittest
import warnings
from geopy.point import Point
class PointTestCase(unittest.TestCase):
lat = 40.74113
lon = -73.989656
alt = 3
coords = (lat, lon, alt)
def test_point_slices(self):
point = Point(self.lat, self.lon, self.alt)
self... | point[:]) | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | v2_extractor_at_anchor |
geopy/geopy | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | train | train | test/test_proxy.py | test_ssl_context_with_proxy_is_respected | self.assertIn | func_call | 38 | import os
import ssl
import unittest
from urllib.request import getproxies, urlopen
from geopy.exc import GeocoderServiceError
from geopy.geocoders.base import Geocoder
from test.proxy_server import HttpServerThread, ProxyServerThread
CERT_SELFSIGNED_CA = os.path.join(os.path.dirname(__file__), 'selfsigned_ca.pem')
... | str(cm.exception)) | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | v2_extractor_at_anchor |
geopy/geopy | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | train | train | test/test_proxy.py | test_ssl_context_with_proxy_is_respected | self.assertRaises | variable | 36 | import os
import ssl
import unittest
from urllib.request import getproxies, urlopen
from geopy.exc import GeocoderServiceError
from geopy.geocoders.base import Geocoder
from test.proxy_server import HttpServerThread, ProxyServerThread
CERT_SELFSIGNED_CA = os.path.join(os.path.dirname(__file__), 'selfsigned_ca.pem')
... | GeocoderServiceError) | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | v2_extractor_at_anchor |
geopy/geopy | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | train | train | test/test_proxy.py | setUp | self.assertIsNone | func_call | 38 | import os
import ssl
import unittest
from urllib.request import getproxies, urlopen
from geopy.exc import GeocoderServiceError
from geopy.geocoders.base import Geocoder
from test.proxy_server import HttpServerThread, ProxyServerThread
CERT_SELFSIGNED_CA = os.path.join(os.path.dirname(__file__), 'selfsigned_ca.pem')
... | os.environ.get('http_proxy')) | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | v2_extractor_at_anchor |
geopy/geopy | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | train | train | test/test_proxy.py | setUp | self.assertIsNone | func_call | 38 | import os
import ssl
import unittest
from urllib.request import getproxies, urlopen
from geopy.exc import GeocoderServiceError
from geopy.geocoders.base import Geocoder
from test.proxy_server import HttpServerThread, ProxyServerThread
CERT_SELFSIGNED_CA = os.path.join(os.path.dirname(__file__), 'selfsigned_ca.pem')
... | os.environ.get('https_proxy')) | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | v2_extractor_at_anchor |
geopy/geopy | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | train | train | test/test_proxy.py | test_geocoder_constructor_uses_https_proxy | self.assertEqual | func_call | 34 | import os
import ssl
import unittest
from urllib.request import getproxies, urlopen
from geopy.exc import GeocoderServiceError
from geopy.geocoders.base import Geocoder
from test.proxy_server import HttpServerThread, ProxyServerThread
CERT_SELFSIGNED_CA = os.path.join(os.path.dirname(__file__), 'selfsigned_ca.pem')
... | len(self.proxy_server.requests)) | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | v2_extractor_at_anchor |
geopy/geopy | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | train | train | test/test_timezone.py | test_create_from_timezone_name | self.assertEqual | string_literal | 20 | import datetime
import pickle
import unittest
import pytz
import pytz.tzinfo
from geopy.timezone import Timezone, from_fixed_gmt_offset, from_timezone_name
class TimezoneTestCase(unittest.TestCase):
timezone_gmt_offset_hours = 3.0
timezone_name = "Europe/Moscow" # a DST-less timezone
def test_create_f... | 'bar') | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | v2_extractor_at_anchor |
geopy/geopy | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | train | train | test/test_timezone.py | test_picklable | self.assertEqual | variable | 23 | import datetime
import pickle
import unittest
import pytz
import pytz.tzinfo
from geopy.timezone import Timezone, from_fixed_gmt_offset, from_timezone_name
class TimezoneTestCase(unittest.TestCase):
timezone_gmt_offset_hours = 3.0
timezone_name = "Europe/Moscow" # a DST-less timezone
def test_picklabl... | tz_unp) | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | v2_extractor_at_anchor |
geopy/geopy | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | train | train | test/test_timezone.py | test_create_from_pytz_timezone | self.assertIs | variable | 19 | import datetime
import pickle
import unittest
import pytz
import pytz.tzinfo
from geopy.timezone import Timezone, from_fixed_gmt_offset, from_timezone_name
class TimezoneTestCase(unittest.TestCase):
timezone_gmt_offset_hours = 3.0
timezone_name = "Europe/Moscow" # a DST-less timezone
def test_create_f... | pytz_timezone) | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | v2_extractor_at_anchor |
geopy/geopy | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | train | train | test/test_timezone.py | test_create_from_timezone_name | self.assertIsInstance | complex_expr | 22 | import datetime
import pickle
import unittest
import pytz
import pytz.tzinfo
from geopy.timezone import Timezone, from_fixed_gmt_offset, from_timezone_name
class TimezoneTestCase(unittest.TestCase):
timezone_gmt_offset_hours = 3.0
timezone_name = "Europe/Moscow" # a DST-less timezone
def test_create_f... | datetime.tzinfo) | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | v2_extractor_at_anchor |
geopy/geopy | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | train | train | test/test_timezone.py | test_string | self.assertEqual | complex_expr | 19 | import datetime
import pickle
import unittest
import pytz
import pytz.tzinfo
from geopy.timezone import Timezone, from_fixed_gmt_offset, from_timezone_name
class TimezoneTestCase(unittest.TestCase):
timezone_gmt_offset_hours = 3.0
timezone_name = "Europe/Moscow" # a DST-less timezone
def test_string(s... | self.timezone_name) | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | v2_extractor_at_anchor |
geopy/geopy | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | train | train | test/test_timezone.py | test_eq | self.assertEqual | func_call | 20 | import datetime
import pickle
import unittest
import pytz
import pytz.tzinfo
from geopy.timezone import Timezone, from_fixed_gmt_offset, from_timezone_name
class TimezoneTestCase(unittest.TestCase):
timezone_gmt_offset_hours = 3.0
timezone_name = "Europe/Moscow" # a DST-less timezone
def test_eq(self)... | Timezone(tz, raw2)) | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | v2_extractor_at_anchor |
geopy/geopy | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | train | train | test/test_timezone.py | test_ne | self.assertNotEqual | func_call | 20 | import datetime
import pickle
import unittest
import pytz
import pytz.tzinfo
from geopy.timezone import Timezone, from_fixed_gmt_offset, from_timezone_name
class TimezoneTestCase(unittest.TestCase):
timezone_gmt_offset_hours = 3.0
timezone_name = "Europe/Moscow" # a DST-less timezone
def test_ne(self)... | Timezone(tz2, raw)) | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | v2_extractor_at_anchor |
geopy/geopy | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | train | train | test/test_timezone.py | test_create_from_timezone_name | self.assertIsInstance | complex_expr | 21 | import datetime
import pickle
import unittest
import pytz
import pytz.tzinfo
from geopy.timezone import Timezone, from_fixed_gmt_offset, from_timezone_name
class TimezoneTestCase(unittest.TestCase):
timezone_gmt_offset_hours = 3.0
timezone_name = "Europe/Moscow" # a DST-less timezone
def test_create_f... | pytz.tzinfo.BaseTzInfo) | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | v2_extractor_at_anchor |
geopy/geopy | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | train | train | test/test_timezone.py | test_create_from_fixed_gmt_offset | self.assertEqual | func_call | 26 | import datetime
import pickle
import unittest
import pytz
import pytz.tzinfo
from geopy.timezone import Timezone, from_fixed_gmt_offset, from_timezone_name
class TimezoneTestCase(unittest.TestCase):
timezone_gmt_offset_hours = 3.0
timezone_name = "Europe/Moscow" # a DST-less timezone
def test_create_f... | olson_tz.utcoffset(dt)) | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | v2_extractor_at_anchor |
geopy/geopy | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | train | train | test/test_timezone.py | test_repr | self.assertEqual | string_literal | 20 | import datetime
import pickle
import unittest
import pytz
import pytz.tzinfo
from geopy.timezone import Timezone, from_fixed_gmt_offset, from_timezone_name
class TimezoneTestCase(unittest.TestCase):
timezone_gmt_offset_hours = 3.0
timezone_name = "Europe/Moscow" # a DST-less timezone
def test_repr(sel... | "Timezone(%s)" % repr(pytz_timezone)) | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | v2_extractor_at_anchor |
geopy/geopy | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | train | train | test/test_timezone.py | test_with_unpicklable_raw | self.assertRaises | collection | 22 | import datetime
import pickle
import unittest
import pytz
import pytz.tzinfo
from geopy.timezone import Timezone, from_fixed_gmt_offset, from_timezone_name
class TimezoneTestCase(unittest.TestCase):
timezone_gmt_offset_hours = 3.0
timezone_name = "Europe/Moscow" # a DST-less timezone
def test_with_unp... | (AttributeError, pickle.PicklingError)) | 1c1cfd516c095abc38fe3ff00d82071d0290edaf | 282 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/premium/test_branches.py | test__allow_more_than_one_user_by_ids | assert | collection | 52 | import pytest
import gitlab
from gitlabform.gitlab import AccessLevel
from tests.acceptance import get_only_branch_access_levels, run_gitlabform
pytestmark = pytest.mark.requires_license
class TestBranches:
def test__allow_more_than_one_user_by_ids(self, project, branch, make_user):
first_user = make_u... | [] | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/premium/test_branches_users_case_insensitive.py | test__users_case_insensitive | assert | collection | 58 | import pytest
from gitlabform.gitlab import AccessLevel
from tests.acceptance import (
run_gitlabform,
randomize_case,
get_only_branch_access_levels,
)
pytestmark = pytest.mark.requires_license
class TestBranchesUsersCaseInsensitive:
def test__users_case_insensitive(
self,
project,
... | [] | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/premium/test_tags.py | test__allowed_to_create_by_user_only | assert | collection | 36 | import pytest
import gitlab
from gitlabform.gitlab import AccessLevel
from tests.acceptance import get_only_tag_access_levels, run_gitlabform
pytestmark = pytest.mark.requires_license
class TestTags:
def test__allowed_to_create_by_user_only(self, project, tag, make_user):
user1 = make_user(AccessLevel.DE... | [] | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/standard/test_branches.py | test__protect_and_unprotect | assert | collection | 29 | from gitlabform.gitlab import AccessLevel
from tests.acceptance import get_only_branch_access_levels, run_gitlabform
class TestBranches:
def test__protect_and_unprotect(self, project, branch):
config_protect_branch = f"""
projects_and_groups:
{project.path_with_namespace}:
bra... | [] | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/standard/test_files.py | test__set_file_protected_branches | assert | collection | 85 | import os
import pytest
from gitlab import GitlabGetError
from gitlabform.gitlab import AccessLevel
from tests.acceptance import (
get_only_branch_access_levels,
run_gitlabform,
DEFAULT_README,
)
def no_access_branch(project):
branch = project.branches.create({"branch": "no_access_branch", "ref": "ma... | [] | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/unit/configuration/test_projects_and_groups.py | test__get_effective_config_for_project__other_project | assert | collection | 39 | import logging
import pytest
from gitlabform.configuration import Configuration
logger = logging.getLogger(__name__)
def configuration_with_only_group_and_project():
config_yaml = """
---
projects_and_groups:
some_group/*:
project_settings:
foo: bar
hooks:
a:
... | {} | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/unit/processors/test_branch_protector.py | test_get_current_permissions_handles_zero_access_level | assert | collection | 22 | from gitlabform.processors.util.branch_protector import BranchProtector
def test_get_current_permissions_handles_zero_access_level():
bp = BranchProtector(None, False)
test_protected_branches_response = {
"id": 1,
"name": "master",
"push_access_levels": [
{"access_level": 0,... | [0] | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/unit/processors/test_branch_protector.py | test_get_current_permissions_handles_zero_access_level | assert | collection | 27 | from gitlabform.processors.util.branch_protector import BranchProtector
def test_get_current_permissions_handles_zero_access_level():
bp = BranchProtector(None, False)
test_protected_branches_response = {
"id": 1,
"name": "master",
"push_access_levels": [
{"access_level": 0,... | [40] | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/standard/test_hooks.py | test_hooks_create | assert | collection | 62 | import logging
import pytest
from typing import TYPE_CHECKING
from gitlab.v4.objects import ProjectHook
from tests.acceptance import run_gitlabform, get_random_name
def urls():
first_name = get_random_name("hook")
second_name = get_random_name("hook")
third_name = get_random_name("hook")
first_url = f... | (True, True) | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/standard/test_hooks.py | test_hooks_create | assert | collection | 54 | import logging
import pytest
from typing import TYPE_CHECKING
from gitlab.v4.objects import ProjectHook
from tests.acceptance import run_gitlabform, get_random_name
def urls():
first_name = get_random_name("hook")
second_name = get_random_name("hook")
third_name = get_random_name("hook")
first_url = f... | (False, True) | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/unit/configuration/test_yaml_version.py | test__default_yaml_11 | assert | collection | 21 | import logging
import pytest
from gitlabform.configuration import Configuration
logger = logging.getLogger(__name__)
def configuration_with_yes():
config_yaml = """
---
projects_and_groups:
some_group/*:
project_settings:
foo: yes # in YAML 1.1 this should be interpreted... | {"foo": True} | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/standard/test_group_variables.py | test__more_variables | assert | collection | 24 | from tests.acceptance import run_gitlabform
class TestGroupVariables:
def test__more_variables(self, group_for_function):
config_more_variables = f"""
projects_and_groups:
{group_for_function.full_path}/*:
group_variables:
foo:
key: FOO
... | {"FOO", "BAR"} | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/standard/test_group_members_groups.py | test__remove_group | assert | collection | 69 | import pytest
from gitlabform.gitlab import AccessLevel
from tests.acceptance import (
allowed_codes,
run_gitlabform,
)
def one_owner(root_user, group, groups, subgroup, users):
group.members.create(
{"user_id": users[0].id, "access_level": AccessLevel.OWNER.value}
)
group.members.delete(r... | [groups[0].name] | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/unit/configuration/test_case_sensitivity.py | test__config_with_different_case_project | assert | collection | 27 | import pytest
from gitlabform import EXIT_INVALID_INPUT
from gitlabform.configuration import Configuration
def test__config_with_different_case_project():
group_and_project_name_with_varying_case = (
"GroupNameWithVaryingCase/projectwithvaryingcase"
)
config_yaml = f"""
projects_and_groups:
... | {"visibility": "public"} | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/unit/configuration/test_case_sensitivity.py | test__config_with_different_case_group | assert | collection | 23 | import pytest
from gitlabform import EXIT_INVALID_INPUT
from gitlabform.configuration import Configuration
def test__config_with_different_case_group():
group_name_with_varying_case = "GROUPnameWITHvaryingCASE"
config_yaml = f"""
projects_and_groups:
{group_name_with_varying_case}/*:
projec... | {"visibility": "internal"} | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/unit/configuration/test_projects_and_groups.py | test__get_effective_config_for_project__project_from_config__additive_project_settings | assert | collection | 42 | import logging
import pytest
from gitlabform.configuration import Configuration
logger = logging.getLogger(__name__)
def configuration_with_only_group_and_project():
config_yaml = """
---
projects_and_groups:
some_group/*:
project_settings:
foo: bar
hooks:
a:
... | {"foo": "bar", "bar": "foo"} | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/premium/test_branches.py | test__allow_user_ids | assert | collection | 44 | import pytest
import gitlab
from gitlabform.gitlab import AccessLevel
from tests.acceptance import get_only_branch_access_levels, run_gitlabform
pytestmark = pytest.mark.requires_license
class TestBranches:
def test__allow_user_ids(self, project, branch, make_user):
user_allowed_to_push = make_user(Acc... | [AccessLevel.NO_ACCESS.value] | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/premium/test_branches.py | test__allow_user_ids | assert | collection | 45 | import pytest
import gitlab
from gitlabform.gitlab import AccessLevel
from tests.acceptance import get_only_branch_access_levels, run_gitlabform
pytestmark = pytest.mark.requires_license
class TestBranches:
def test__allow_user_ids(self, project, branch, make_user):
user_allowed_to_push = make_user(Acc... | [AccessLevel.DEVELOPER.value] | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/standard/test_branches.py | test__config_with_access_level_names | assert | collection | 28 | from gitlabform.gitlab import AccessLevel
from tests.acceptance import get_only_branch_access_levels, run_gitlabform
class TestBranches:
def test__config_with_access_level_names(self, project, branch):
config_with_access_levels_names = f"""
projects_and_groups:
{project.path_with_namespa... | [AccessLevel.NO_ACCESS.value] | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/standard/test_branches.py | test__config_with_access_level_names | assert | collection | 29 | from gitlabform.gitlab import AccessLevel
from tests.acceptance import get_only_branch_access_levels, run_gitlabform
class TestBranches:
def test__config_with_access_level_names(self, project, branch):
config_with_access_levels_names = f"""
projects_and_groups:
{project.path_with_namespa... | [AccessLevel.DEVELOPER.value] | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/standard/test_inheritance_break.py | test__inheritance_break | assert | collection | 57 | from gitlabform.gitlab import AccessLevel
from tests.acceptance import (
run_gitlabform,
get_only_branch_access_levels,
)
class TestInheritanceBreak:
def test__inheritance_break(
self,
group,
project,
branch,
other_branch,
):
config_yaml = f"""
pr... | [AccessLevel.DEVELOPER.value] | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/premium/test_branches.py | test__allow_more_than_one_user_by_ids | assert | collection | 43 | import pytest
import gitlab
from gitlabform.gitlab import AccessLevel
from tests.acceptance import get_only_branch_access_levels, run_gitlabform
pytestmark = pytest.mark.requires_license
class TestBranches:
def test__allow_more_than_one_user_by_ids(self, project, branch, make_user):
first_user = make_u... | [AccessLevel.MAINTAINER.value] | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/premium/test_branches_users_case_insensitive.py | test__users_case_insensitive | assert | collection | 49 | import pytest
from gitlabform.gitlab import AccessLevel
from tests.acceptance import (
run_gitlabform,
randomize_case,
get_only_branch_access_levels,
)
pytestmark = pytest.mark.requires_license
class TestBranchesUsersCaseInsensitive:
def test__users_case_insensitive(
self,
project,
... | [AccessLevel.MAINTAINER.value] | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/standard/test_files.py | test__set_file_protected_branches | assert | collection | 83 | import os
import pytest
from gitlab import GitlabGetError
from gitlabform.gitlab import AccessLevel
from tests.acceptance import (
get_only_branch_access_levels,
run_gitlabform,
DEFAULT_README,
)
def no_access_branch(project):
branch = project.branches.create({"branch": "no_access_branch", "ref": "ma... | [AccessLevel.MAINTAINER.value] | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/standard/test_hooks.py | test_hooks_create | assert | collection | 58 | import logging
import pytest
from typing import TYPE_CHECKING
from gitlab.v4.objects import ProjectHook
from tests.acceptance import run_gitlabform, get_random_name
def urls():
first_name = get_random_name("hook")
second_name = get_random_name("hook")
third_name = get_random_name("hook")
first_url = f... | ( True, True, ) | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/standard/test_group_members_groups.py | test__not_remove_groups_with_enforce_false | assert | collection | 75 | import pytest
from gitlabform.gitlab import AccessLevel
from tests.acceptance import (
allowed_codes,
run_gitlabform,
)
def one_owner(root_user, group, groups, subgroup, users):
group.members.create(
{"user_id": users[0].id, "access_level": AccessLevel.OWNER.value}
)
group.members.delete(r... | { f"{users[0].username}", } | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/unit/configuration/test_inheritance_break_subgroups.py | test__inheritance_break__flag_set_at_subgroup_level__subgroup_inherits_nothing | assert | collection | 32 | import logging
import pytest
from gitlabform.configuration import Configuration
logger = logging.getLogger(__name__)
class TestInheritanceBreakSubgroups:
def test__inheritance_break__flag_set_at_subgroup_level__subgroup_inherits_nothing(
self,
):
config_yaml = """
---
projects... | { "project_settings": {"fizz": "buzz"}, } | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/unit/configuration/test_projects_and_groups.py | test__get_effective_config_for_project__project_from_config__additive_hooks | assert | collection | 40 | import logging
import pytest
from gitlabform.configuration import Configuration
logger = logging.getLogger(__name__)
def configuration_with_only_group_and_project():
config_yaml = """
---
projects_and_groups:
some_group/*:
project_settings:
foo: bar
hooks:
a:
... | { "a": {"foo": "bar"}, "b": {"bar": "foo"}, } | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/unit/configuration/test_inheritance_break_projects_and_groups.py | test__inheritance_break__flag_set_at_group_level__group_inherits_nothing | assert | collection | 36 | import logging
from gitlabform.configuration import Configuration
logger = logging.getLogger(__name__)
class TestInheritanceBreakProjectsAndGroups:
def test__inheritance_break__flag_set_at_group_level__group_inherits_nothing(
self,
):
config_yaml = """
---
projects_and_groups... | { "secret2": {"key": "foo", "value": "bar"}, } | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/unit/configuration/test_inheritance_break_projects_and_groups.py | test__inheritance_break__flag_set_at_project_level__project_inherits_nothing | assert | collection | 43 | import logging
from gitlabform.configuration import Configuration
logger = logging.getLogger(__name__)
class TestInheritanceBreakProjectsAndGroups:
def test__inheritance_break__flag_set_at_project_level__project_inherits_nothing(
self,
):
config_yaml = """
---
projects_and_gro... | { "secret3": {"key": "bizz", "value": "buzz"}, } | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/unit/configuration/test_projects_and_groups.py | test__get_effective_config_for_project__configuration_for_other_project | assert | collection | 51 | import logging
import pytest
from gitlabform.configuration import Configuration
logger = logging.getLogger(__name__)
def configuration_with_only_group_and_project():
config_yaml = """
---
projects_and_groups:
some_group/*:
project_settings:
foo: bar
hooks:
a:
... | { "variables": { "first": { "key": "foo", "value": "bar", }, } } | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/standard/test_application_settings.py | test__can_set_asset_proxy_allowlist_array_field_into_application_settings | assert | collection | 27 | import logging
from tests.acceptance import run_gitlabform
class TestApplicationSettings:
def test__can_set_asset_proxy_allowlist_array_field_into_application_settings(
self, gl, project
):
initial_settings = gl.settings.get()
assert initial_settings is not None
assert initial... | [ "example.com", "*.example.com", "your-instance.com", "localhost", ] | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/unit/configuration/test_inheritance_break_subgroups.py | test__inheritance_break__flag_set_at_project_level__second_subgroup_project_inherits_nothing | assert | collection | 56 | import logging
import pytest
from gitlabform.configuration import Configuration
logger = logging.getLogger(__name__)
class TestInheritanceBreakSubgroups:
def configuration_with_inheritance_break_set_at_subgroup_and_project_level(self):
config_yaml = """
---
projects_and_groups:
... | { "group_settings": {"snap": "pop"}, "project_settings": { "fizz": "buzz", }, } | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/unit/configuration/test_inheritance_break_subgroups.py | test__inheritance_break__flag_set_at_project_level__first_subgroup_project_does_not_inherit_project_settings | assert | collection | 56 | import logging
import pytest
from gitlabform.configuration import Configuration
logger = logging.getLogger(__name__)
class TestInheritanceBreakSubgroups:
def configuration_with_inheritance_break_set_at_subgroup_and_project_level(self):
config_yaml = """
---
projects_and_groups:
... | { "group_settings": {"crackle": "pop"}, "project_settings": { "fizz": "buzz", }, } | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/unit/configuration/test_inheritance_break_subgroups.py | test__inheritance_break__flag_set_at_subgroup_level__second_subgroup_does_not_inherit_project_settings | assert | collection | 56 | import logging
import pytest
from gitlabform.configuration import Configuration
logger = logging.getLogger(__name__)
class TestInheritanceBreakSubgroups:
def configuration_with_inheritance_break_set_at_subgroup_and_project_level(self):
config_yaml = """
---
projects_and_groups:
... | { "group_settings": {"crackle": "pop"}, "project_settings": { "foo2": "bar2", }, } | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/unit/configuration/test_inheritance_break_projects_and_groups.py | test__inheritance_break__flag_set_at_group_level__project_inherits_group_and_not_common | assert | collection | 44 | import logging
from gitlabform.configuration import Configuration
logger = logging.getLogger(__name__)
class TestInheritanceBreakProjectsAndGroups:
def test__inheritance_break__flag_set_at_group_level__project_inherits_group_and_not_common(
self,
):
config_yaml = """
---
proj... | { "secret2": {"key": "foo", "value": "bar"}, "secret3": {"key": "bizz", "value": "buzz"}, } | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/premium/test_branches.py | test__code_owners_approval | assert | bool_literal | 35 | import pytest
import gitlab
from gitlabform.gitlab import AccessLevel
from tests.acceptance import get_only_branch_access_levels, run_gitlabform
pytestmark = pytest.mark.requires_license
class TestBranches:
def test__code_owners_approval(self, project, branch):
try:
protected_branch = projec... | True | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/premium/test_merge_request_approvals_settings.py | test__edit_settings | assert | bool_literal | 26 | import pytest
from tests.acceptance import run_gitlabform, gl
pytestmark = pytest.mark.requires_license
class TestMergeRequestApprovalsSettings:
def test__edit_settings(self, project, make_user):
config = f"""
projects_and_groups:
{project.path_with_namespace}:
project_setti... | True | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/standard/test_application_settings.py | test__can_set_2fa_application_settings | assert | bool_literal | 25 | import logging
from tests.acceptance import run_gitlabform
class TestApplicationSettings:
def test__can_set_2fa_application_settings(self, gl, project):
initial_settings = gl.settings.get()
assert initial_settings is not None
assert initial_settings.require_two_factor_authentication is Fal... | True | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/standard/test_archive_project.py | test__archive_project | assert | bool_literal | 17 | from tests.acceptance import (
run_gitlabform,
)
class TestArchiveProject:
def test__archive_project(self, gl, project):
config = f"""
projects_and_groups:
{project.path_with_namespace}:
project:
archive: true
"""
run_gitlabform(config, proje... | True | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/standard/test_files.py | test__set_file_specific_branch | assert | bool_literal | 86 | import os
import pytest
from gitlab import GitlabGetError
from gitlabform.gitlab import AccessLevel
from tests.acceptance import (
get_only_branch_access_levels,
run_gitlabform,
DEFAULT_README,
)
def no_access_branch(project):
branch = project.branches.create({"branch": "no_access_branch", "ref": "ma... | True | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/standard/test_files_protected.py | test__set_file_protected_branches | assert | bool_literal | 42 | from tests.acceptance import run_gitlabform, DEFAULT_README
class TestFilesProtected:
def test__set_file_protected_branches(self, project, branch, other_branch):
set_file_protected_branches = f"""
projects_and_groups:
{project.path_with_namespace}:
branches:
mai... | True | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/standard/test_group_variables.py | test__protected_change_variables | assert | bool_literal | 36 | from tests.acceptance import run_gitlabform
class TestGroupVariables:
def test__protected_change_variables(self, group_for_function):
config_single_variable = f"""
projects_and_groups:
{group_for_function.full_path}/*:
group_variables:
foo:
key: ... | True | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/standard/test_integrations.py | test__if_push_events_true_works | assert | bool_literal | 44 | import pytest
from gitlab import GitlabGetError
from tests.acceptance import allowed_codes, run_gitlabform
def integrations(project):
integrations = ["asana", "slack", "redmine", "jira", "mattermost"]
yield integrations
# disable test integrations
for integration in integrations:
with allowe... | True | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/standard/test_running.py | test__ALL | assert | bool_literal | 22 | import pytest
from tests.acceptance import (
run_gitlabform,
)
from pathlib import Path
from ruamel.yaml import YAML
class TestRunning:
def test__ALL(self, gl, project, other_project):
config = f"""
projects_and_groups:
'*':
project_settings:
request_access_... | True | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/standard/test_schedules.py | test__add_new_schedule | assert | bool_literal | 69 | import logging
import pytest
from tests.acceptance import run_gitlabform
def schedules(project):
another_branch = "scheduled/new-feature"
project.branches.create({"branch": another_branch, "ref": "main"})
# fmt: off
schedules = [
("Existing schedule", "main", "0 * * * *", True),
("Exi... | True | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/standard/test_transfer_project.py | test__transfer_and_archive | assert | bool_literal | 36 | from tests.acceptance import (
get_random_suffix,
run_gitlabform,
)
from gitlabform.gitlab import AccessLevel
from gitlab import GitlabTransferProjectError
import re
import pytest
class TestTransferProject:
def test__transfer_and_archive(self, gl, project_for_function, group, other_group):
project... | True | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/premium/test_branches.py | test__code_owners_approval | assert | bool_literal | 15 | import pytest
import gitlab
from gitlabform.gitlab import AccessLevel
from tests.acceptance import get_only_branch_access_levels, run_gitlabform
pytestmark = pytest.mark.requires_license
class TestBranches:
def test__code_owners_approval(self, project, branch):
try:
protected_branch = projec... | False | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/premium/test_merge_request_approvals_settings.py | test__edit_settings | assert | bool_literal | 25 | import pytest
from tests.acceptance import run_gitlabform, gl
pytestmark = pytest.mark.requires_license
class TestMergeRequestApprovalsSettings:
def test__edit_settings(self, project, make_user):
config = f"""
projects_and_groups:
{project.path_with_namespace}:
project_setti... | False | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/standard/test_application_settings.py | test__can_set_2fa_application_settings | assert | bool_literal | 10 | import logging
from tests.acceptance import run_gitlabform
class TestApplicationSettings:
def test__can_set_2fa_application_settings(self, gl, project):
initial_settings = gl.settings.get()
assert initial_settings is not None
assert initial_settings.require_two_factor_authentication is | False | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/standard/test_archive_project.py | test__unarchive_project | assert | bool_literal | 40 | from tests.acceptance import (
run_gitlabform,
)
class TestArchiveProject:
def test__unarchive_project(self, gl, project, other_group, other_project):
archive_project = f"""
projects_and_groups:
{project.path_with_namespace}:
project:
archive: true
"... | False | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/standard/test_files_all.py | test__set_file_all_branches | assert | bool_literal | 39 | from tests.acceptance import run_gitlabform
class TestFilesAll:
def test__set_file_all_branches(self, project, branch, other_branch):
set_file_all_branches = f"""
projects_and_groups:
{project.path_with_namespace}:
branches:
{branch}:
protected: ... | False | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/premium/test_tags.py | test__allowed_to_create_by_user_and_role | assert | func_call | 38 | import pytest
import gitlab
from gitlabform.gitlab import AccessLevel
from tests.acceptance import get_only_tag_access_levels, run_gitlabform
pytestmark = pytest.mark.requires_license
class TestTags:
def test__allowed_to_create_by_user_and_role(self, project, tag, make_user):
user1 = make_user(AccessLev... | sorted([user1.id]) | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/standard/test_members_enforce.py | test__enforce | assert | func_call | 26 | import pytest
from gitlabform.gitlab import AccessLevel
from tests.acceptance import (
run_gitlabform,
)
def bot_member(gl, make_project_access_token, project_for_function):
token = make_project_access_token(target_project=project_for_function)
bot_member = gl.users.get(token.user_id)
yield bot_memb... | len(three_members) | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/standard/test_members.py | test__add_user | assert | func_call | 29 | import pytest
from gitlabform.gitlab import AccessLevel
from tests.acceptance import (
run_gitlabform,
)
class TestMembers:
def test__add_user(self, project, three_members, outsider_user):
members_before = project.members.list()
assert len(members_before) > 0
members_usernames_before ... | len(members_before) + 1 | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/premium/test_tags.py | test__allowed_to_create_by_user_only | assert | func_call | 35 | import pytest
import gitlab
from gitlabform.gitlab import AccessLevel
from tests.acceptance import get_only_tag_access_levels, run_gitlabform
pytestmark = pytest.mark.requires_license
class TestTags:
def test__allowed_to_create_by_user_only(self, project, tag, make_user):
user1 = make_user(AccessLevel.DE... | sorted([user1.id, user2.id]) | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/standard/test_hooks.py | test_hooks_delete | assert | func_call | 60 | import logging
import pytest
from typing import TYPE_CHECKING
from gitlab.v4.objects import ProjectHook
from tests.acceptance import run_gitlabform, get_random_name
def urls():
first_name = get_random_name("hook")
second_name = get_random_name("hook")
third_name = get_random_name("hook")
first_url = f... | third_hook_before_test.asdict() | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/standard/test_members.py | test__add_user_with_access_level_names | assert | func_call | 32 | import pytest
from gitlabform.gitlab import AccessLevel
from tests.acceptance import (
run_gitlabform,
)
class TestMembers:
def test__add_user_with_access_level_names(
self, project, three_members, outsider_user
):
members_before = project.members.list()
assert len(members_before)... | len(members_usernames_before) + 1 | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/premium/test_tags.py | test__allowed_to_create_by_user_only | assert | func_call | 34 | import pytest
import gitlab
from gitlabform.gitlab import AccessLevel
from tests.acceptance import get_only_tag_access_levels, run_gitlabform
pytestmark = pytest.mark.requires_license
class TestTags:
def test__allowed_to_create_by_user_only(self, project, tag, make_user):
user1 = make_user(AccessLevel.DE... | sorted([AccessLevel.NO_ACCESS.value]) | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/standard/test_transfer_project.py | test__transfer_as_different_path | assert | func_call | 31 | from tests.acceptance import (
get_random_suffix,
run_gitlabform,
)
from gitlabform.gitlab import AccessLevel
from gitlab import GitlabTransferProjectError
import re
import pytest
class TestTransferProject:
def test__transfer_as_different_path(
self, gl, project_for_function, group, other_group
... | len(projects_in_new_path_before_transfer) + 1 | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/premium/test_tags.py | test__allowed_to_create_by_group_only | assert | func_call | 37 | import pytest
import gitlab
from gitlabform.gitlab import AccessLevel
from tests.acceptance import get_only_tag_access_levels, run_gitlabform
pytestmark = pytest.mark.requires_license
class TestTags:
def test__allowed_to_create_by_group_only(
self, project, tag, group_to_invite_to_project
):
... | sorted( [ AccessLevel.NO_ACCESS.value, ] ) | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/premium/test_tags.py | test__allowed_to_create_by_dev_role_only | assert | func_call | 30 | import pytest
import gitlab
from gitlabform.gitlab import AccessLevel
from tests.acceptance import get_only_tag_access_levels, run_gitlabform
pytestmark = pytest.mark.requires_license
class TestTags:
def test__allowed_to_create_by_dev_role_only(self, project, tag):
config_tag_protection_allowed_to_creat... | sorted( [ AccessLevel.DEVELOPER.value, ] ) | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/premium/test_tags.py | test__allowed_to_create_by_user_and_role | assert | func_call | 33 | import pytest
import gitlab
from gitlabform.gitlab import AccessLevel
from tests.acceptance import get_only_tag_access_levels, run_gitlabform
pytestmark = pytest.mark.requires_license
class TestTags:
def test__allowed_to_create_by_user_and_role(self, project, tag, make_user):
user1 = make_user(AccessLev... | sorted( [ AccessLevel.MAINTAINER.value, ] ) | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/premium/test_tags.py | test__allowed_to_create_by_group_only | assert | func_call | 43 | import pytest
import gitlab
from gitlabform.gitlab import AccessLevel
from tests.acceptance import get_only_tag_access_levels, run_gitlabform
pytestmark = pytest.mark.requires_license
class TestTags:
def test__allowed_to_create_by_group_only(
self, project, tag, group_to_invite_to_project
):
... | sorted( [shared_group1.id, shared_group2.id] ) | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/premium/test_branches.py | test__allow_more_than_one_user_by_ids | assert | func_call | 45 | import pytest
import gitlab
from gitlabform.gitlab import AccessLevel
from tests.acceptance import get_only_branch_access_levels, run_gitlabform
pytestmark = pytest.mark.requires_license
class TestBranches:
def test__allow_more_than_one_user_by_ids(self, project, branch, make_user):
first_user = make_u... | sorted( [ first_user.id, second_user.id, third_user.id, ] ) | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/premium/test_protected_environments.py | test__protect_a_second_repository_environment | assert | complex_expr | 33 | import pytest
from gitlabform.gitlab import AccessLevel
from tests.acceptance import run_gitlabform, gl
pytestmark = pytest.mark.requires_license
class TestProtectedEnvironments:
def test__protect_a_second_repository_environment(self, project, make_user) -> str:
user1 = make_user(AccessLevel.DEVELOPER)
... | user1.id | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/premium/test_group_settings.py | test__edit_new_setting_premium | assert | complex_expr | 22 | import pytest
from tests.acceptance import run_gitlabform
pytestmark = pytest.mark.requires_license
class TestGroupSettings:
def test__edit_new_setting_premium(self, gl, project, group):
assert "file_template_project_id" not in group.attributes
edit_group_settings = f"""
projects_and_gro... | project.id | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/standard/test_application_settings.py | test__can_detect_when_no_changes_required_to_application_settings | assert | complex_expr | 35 | import logging
from tests.acceptance import run_gitlabform
class TestApplicationSettings:
def test__can_detect_when_no_changes_required_to_application_settings(
self, gl, project, caplog
):
caplog.set_level(logging.DEBUG)
initial_settings = gl.settings.get()
initial_settings.... | caplog.text | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/standard/test_hooks.py | test_hooks_delete | assert | complex_expr | 64 | import logging
import pytest
from typing import TYPE_CHECKING
from gitlab.v4.objects import ProjectHook
from tests.acceptance import run_gitlabform, get_random_name
def urls():
first_name = get_random_name("hook")
second_name = get_random_name("hook")
third_name = get_random_name("hook")
first_url = f... | caplog.text | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/premium/test_group_settings.py | test__edit_new_setting_premium | assert | complex_expr | 10 | import pytest
from tests.acceptance import run_gitlabform
pytestmark = pytest.mark.requires_license
class TestGroupSettings:
def test__edit_new_setting_premium(self, gl, project, group):
assert "file_template_project_id" not in | group.attributes | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/standard/test_members_enforce.py | test__enforce_keep_bots | assert | complex_expr | 48 | import pytest
from gitlabform.gitlab import AccessLevel
from tests.acceptance import (
run_gitlabform,
)
def bot_member(gl, make_project_access_token, project_for_function):
token = make_project_access_token(target_project=project_for_function)
bot_member = gl.users.get(token.user_id)
yield bot_memb... | bot_member.username | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/standard/test_members_enforce.py | test__enforce | assert | complex_expr | 46 | import pytest
from gitlabform.gitlab import AccessLevel
from tests.acceptance import (
run_gitlabform,
)
def bot_member(gl, make_project_access_token, project_for_function):
token = make_project_access_token(target_project=project_for_function)
bot_member = gl.users.get(token.user_id)
yield bot_memb... | outsider_user.username | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
gitlabform/gitlabform | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | train | train | tests/acceptance/standard/test_group_members_groups.py | test__change_group_access | assert | complex_expr | 66 | import pytest
from gitlabform.gitlab import AccessLevel
from tests.acceptance import (
allowed_codes,
run_gitlabform,
)
def one_owner(root_user, group, groups, subgroup, users):
group.members.create(
{"user_id": users[0].id, "access_level": AccessLevel.OWNER.value}
)
group.members.delete(r... | AccessLevel.OWNER.value | 6dcd0b01104fbd7da88d3496520959fc864b6e1b | 238 | v2_extractor_at_anchor |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.