repo_id stringclasses 409
values | prefix large_stringlengths 34 36.3k | target large_stringlengths 1 498 | assertion_type stringclasses 31
values | difficulty stringclasses 8
values | test_file stringlengths 10 121 | test_function stringlengths 1 104 | test_class stringlengths 0 51 | lineno int32 2 11.3k | commit_idx int32 |
|---|---|---|---|---|---|---|---|---|---|
benavlabs/fastcrud | from fastapi.testclient import TestClient
from fastcrud import EndpointCreator
async def custom_endpoint(foo: str):
return {"foo": f"{foo}"}
def test_add_custom_route(client: TestClient, endpoint_creator: EndpointCreator):
endpoint_creator.add_custom_route(
endpoint=custom_endpoint,
path="/tes... | {"foo": "bar"} | assert | collection | tests/sqlalchemy/endpoint/test_custom_route.py | test_add_custom_route | 23 | null | |
benavlabs/fastcrud | from fastapi import Depends
from fastcrud.core import FilterConfig
async def get_auth_user():
return UserInfo(organization_id=123)
async def get_org_id(auth: UserInfo = Depends(get_auth_user)):
return auth.organization_id
def test_filter_config_with_callable_value():
filter_config = FilterConfig(
... | None | assert | none_literal | tests/sqlalchemy/core/test_dependency_filter.py | test_filter_config_with_callable_value | 30 | null | |
benavlabs/fastcrud | import pytest
from sqlalchemy import Select, select
from sqlalchemy.exc import ArgumentError
from fastcrud.core.query import SQLQueryBuilder, SortProcessor, JoinBuilder
from tests.sqlalchemy.conftest import ModelTest, TierModel
class TestSQLQueryBuilder:
def test_build_base_select_specific_columns(self):
... | 2 | assert | numeric_literal | tests/sqlalchemy/core/test_query_builder.py | test_build_base_select_specific_columns | TestSQLQueryBuilder | 44 | null |
benavlabs/fastcrud | import pytest
from fastcrud.crud.fast_crud import FastCRUD
from ...sqlalchemy.conftest import ModelTest, ReadSchemaTest
@pytest.mark.asyncio
async def test_get_multi_by_cursor_return_as_model(async_session, test_data):
for item in test_data:
async_session.add(ModelTest(**item))
await async_session.comm... | result | assert | variable | tests/sqlalchemy/crud/test_get_multi_by_cursor.py | test_get_multi_by_cursor_return_as_model | 231 | null | |
benavlabs/fastcrud | import pytest
from fastcrud import FastCRUD, JoinConfig
from pydantic import BaseModel
from sqlmodel import SQLModel, Field, Relationship
from typing import Optional, List
@pytest.mark.asyncio
async def test_composite_pk_deduplication_bug_scenario_1(async_session):
"""
Test scenario 1: Children with same child... | {1, 2} | assert | collection | tests/sqlmodel/crud/test_composite_pk_deduplication_bug.py | test_composite_pk_deduplication_bug_scenario_1 | 142 | null | |
benavlabs/fastcrud | import pytest
from sqlalchemy import Column, Integer, String, ForeignKey, text
from sqlalchemy.orm import DeclarativeBase
from fastcrud import FastCRUD, CountConfig
from ...sqlalchemy.conftest import (
Project,
Participant,
ProjectsParticipantsAssociation,
Author,
Article,
)
@pytest.mark.asyncio
as... | 0 | assert | numeric_literal | tests/sqlalchemy/crud/test_count_config.py | test_count_config_simple_many_to_many | 97 | null | |
benavlabs/fastcrud | import pytest
from pydantic import BaseModel
from sqlalchemy.exc import MultipleResultsFound
from fastcrud.crud.fast_crud import FastCRUD
from ...sqlmodel.conftest import CreateSchemaTest, ModelTest
@pytest.mark.asyncio
async def test_get_with_filters(async_session, test_data):
for item in test_data:
asy... | item["name"] | assert | complex_expr | tests/sqlmodel/crud/test_get.py | test_get_with_filters | 33 | null | |
benavlabs/fastcrud | from typing import Annotated
import pytest
from fastcrud import FastCRUD, JoinConfig, aliased
from pydantic import BaseModel, Field
from sqlalchemy.ext.asyncio import AsyncSession
from ...sqlalchemy.conftest import (
ModelTest,
TierModel,
CreateSchemaTest,
TierSchemaTest,
ReadSchemaTest,
Categor... | 2 | assert | numeric_literal | tests/sqlalchemy/crud/test_get_multi_joined.py | test_get_multi_joined_card_with_articles | 896 | null | |
benavlabs/fastcrud | import pytest
from fastapi import FastAPI
from fastapi.testclient import TestClient
from fastcrud import EndpointCreator
from fastcrud.core import FilterConfig
from tests.sqlalchemy.conftest import ModelTest, CreateSchemaTest, UpdateSchemaTest
def app(async_session) -> FastAPI:
app = FastAPI()
endpoint_creato... | 5 | assert | numeric_literal | tests/sqlalchemy/endpoint/test_endpoint_sorting.py | test_get_multi_with_sort_and_pagination | 116 | null | |
benavlabs/fastcrud | import pytest
from fastapi.testclient import TestClient
@pytest.mark.asyncio
async def test_read_items_with_pagination(
client: TestClient, async_session, test_model, test_data
):
for data in test_data:
new_item = test_model(**data)
async_session.add(new_item)
await async_session.commit()
... | 0 | assert | numeric_literal | tests/sqlalchemy/endpoint/test_get_paginated.py | test_read_items_with_pagination | 29 | null | |
benavlabs/fastcrud | import pytest
from typing import Annotated
from pydantic import BaseModel, Field
from fastcrud.crud.fast_crud import FastCRUD
from sqlalchemy import select, func
@pytest.mark.asyncio
async def test_get_multi_multiple_sorting(async_session, test_model, test_data):
for item in test_data:
async_session.add(te... | sorted(tier_ids) | assert | func_call | tests/sqlmodel/crud/test_get_multi.py | test_get_multi_multiple_sorting | 170 | null | |
benavlabs/fastcrud | import pytest
from fastcrud import FastCRUD
@pytest.mark.asyncio
async def test_or_filter_with_multiple_like_values(async_session, test_model):
"""Test OR filter with multiple values for the same operator (like)"""
# Create test data
test_data = [
{"name": "Alice Johnson", "tier_id": 1, "category_i... | 2 | assert | numeric_literal | tests/sqlalchemy/crud/test_multiple_like_or.py | test_or_filter_with_multiple_like_values | 40 | null | |
benavlabs/fastcrud | import pytest
from sqlalchemy import Select, select
from sqlalchemy.exc import ArgumentError
from fastcrud.core.query import SQLQueryBuilder, SortProcessor, JoinBuilder
from tests.sqlmodel.conftest import ModelTest, TierModel
class TestSQLQueryBuilder:
def test_apply_filters_with_conditions(self):
"""Tes... | stmt | assert | variable | tests/sqlmodel/core/test_query_builder.py | test_apply_filters_with_conditions | TestSQLQueryBuilder | 59 | null |
benavlabs/fastcrud | from fastapi import Depends
from fastcrud.core import FilterConfig
async def get_auth_user():
return UserInfo(organization_id=123)
async def get_org_id(auth: UserInfo = Depends(get_auth_user)):
return auth.organization_id
def test_filter_config_get_params_with_callable():
filter_config = FilterConfig(
... | "test" | assert | string_literal | tests/sqlalchemy/core/test_dependency_filter.py | test_filter_config_get_params_with_callable | 46 | null | |
benavlabs/fastcrud | from datetime import datetime, timezone
import pytest
from sqlalchemy import select
from sqlalchemy.exc import MultipleResultsFound, NoResultFound
from fastcrud.crud.fast_crud import FastCRUD
from ...sqlalchemy.conftest import ModelTest, UpdateSchemaTest, ModelTestWithTimestamp
@pytest.mark.parametrize(
["update... | 1 | assert | numeric_literal | tests/sqlalchemy/crud/test_update.py | test_update_with_returning | 277 | null | |
benavlabs/fastcrud | import pytest
from fastcrud.crud.fast_crud import FastCRUD
@pytest.mark.asyncio
async def test_upsert_successful(async_session, test_model, read_schema):
crud = FastCRUD(test_model)
new_data = read_schema(id=1, name="New Record", tier_id=1, category_id=1)
fetched_record = await crud.upsert(async_session, ... | new_data | assert | variable | tests/sqlmodel/crud/test_upsert.py | test_upsert_successful | 11 | null | |
jorisroovers/gitlint | from unittest.mock import call, patch
from gitlint.git import GitContext
from gitlint.tests.base import BaseTestCase
class GitContextTests(BaseTestCase):
expected_sh_special_args = {"_tty_out": False, "_cwd": "fåke/path"}
@patch("gitlint.git.sh")
def test_gitcontext(self, sh):
sh.git.side_effect... | "foöbar") | self.assertEqual | string_literal | gitlint-core/gitlint/tests/git/test_git_context.py | test_gitcontext | GitContextTests | 28 | null |
jorisroovers/gitlint | import os
from unittest.mock import call, patch
from gitlint.git import (
GitContext,
GitContextError,
GitNotInstalledError,
git_commentchar,
git_hooks_dir,
)
from gitlint.shell import CommandNotFound, ErrorReturnCode
from gitlint.tests.base import BaseTestCase
class GitTests(BaseTestCase):
e... | "test-branch") | self.assertEqual | string_literal | gitlint-core/gitlint/tests/git/test_git.py | test_git_no_commits_get_branch | GitTests | 89 | null |
jorisroovers/gitlint | from gitlint.rules import Rule, RuleViolation
from gitlint.tests.base import BaseTestCase
class RuleTests(BaseTestCase):
def test_rule_equality(self):
# Ensure rules are not equal if they differ on one of their attributes
rule_attrs = ["id", "name", "target", "options"]
for attr in rule_at... | rule2) | self.assertEqual | variable | gitlint-core/gitlint/tests/rules/test_rules.py | test_rule_equality | RuleTests | 19 | null |
jorisroovers/gitlint | from unittest.mock import patch
from gitlint import options, rules
from gitlint.config import (
GITLINT_CONFIG_TEMPLATE_SRC_PATH,
LintConfig,
LintConfigError,
LintConfigGenerator,
)
from gitlint.tests.base import BaseTestCase
class LintConfigGeneratorTests(BaseTestCase):
@staticmethod
@patch("... | "föo/bar/test") | assert_* | string_literal | gitlint-core/gitlint/tests/config/test_config.py | test_install_commit_msg_hook_negative | LintConfigGeneratorTests | 320 | null |
jorisroovers/gitlint | import os
from unittest.mock import call, patch
from gitlint.git import (
GitContext,
GitContextError,
GitNotInstalledError,
git_commentchar,
git_hooks_dir,
)
from gitlint.shell import CommandNotFound, ErrorReturnCode
from gitlint.tests.base import BaseTestCase
class GitTests(BaseTestCase):
e... | "#") | self.assertEqual | string_literal | gitlint-core/gitlint/tests/git/test_git.py | test_git_commentchar | GitTests | 104 | null |
jorisroovers/gitlint | from unittest.mock import patch
from gitlint import options, rules
from gitlint.config import (
GITLINT_CONFIG_TEMPLATE_SRC_PATH,
LintConfig,
LintConfigError,
LintConfigGenerator,
)
from gitlint.tests.base import BaseTestCase
class LintConfigTests(BaseTestCase):
def test_config_equality(self):
... | config2) | self.assertEqual | variable | gitlint-core/gitlint/tests/config/test_config.py | test_config_equality | LintConfigTests | 310 | null |
jorisroovers/gitlint | from gitlint.rules import (
RuleViolation,
TitleHardTab,
TitleLeadingWhitespace,
TitleMaxLength,
TitleMinLength,
TitleMustNotContainWord,
TitleRegexMatches,
TitleTrailingPunctuation,
TitleTrailingWhitespace,
)
from gitlint.tests.base import BaseTestCase
class TitleRuleTests(BaseTest... | violation) | self.assertIsNone | variable | gitlint-core/gitlint/tests/rules/test_title_rules.py | test_max_line_length | TitleRuleTests | 21 | null |
jorisroovers/gitlint | from unittest.mock import call, patch
from gitlint.git import GitContext
from gitlint.tests.base import BaseTestCase
class GitContextTests(BaseTestCase):
expected_sh_special_args = {"_tty_out": False, "_cwd": "fåke/path"}
@patch("gitlint.git.sh")
def test_gitcontext_equality(self, sh):
sh.git.si... | context2) | self.assertEqual | variable | gitlint-core/gitlint/tests/git/test_git_context.py | test_gitcontext_equality | GitContextTests | 45 | null |
jorisroovers/gitlint | from gitlint.rules import Rule, RuleViolation
from gitlint.tests.base import BaseTestCase
class RuleTests(BaseTestCase):
def test_rule_log(self):
rule = Rule()
self.assertIsNone( | rule._log) | self.assertIsNone | complex_expr | gitlint-core/gitlint/tests/rules/test_rules.py | test_rule_log | RuleTests | 25 | null |
jorisroovers/gitlint | from collections import OrderedDict
from gitlint import rules
from gitlint.config import RuleCollection
from gitlint.tests.base import BaseTestCase
class RuleCollectionTests(BaseTestCase):
def test_delete_rules_by_attr(self):
collection = RuleCollection()
collection.add_rules([rules.TitleMaxLengt... | 3) | self.assertEqual | numeric_literal | gitlint-core/gitlint/tests/config/test_rule_collection.py | test_delete_rules_by_attr | RuleCollectionTests | 50 | null |
jorisroovers/gitlint | import os
import sys
from gitlint import options, rules
from gitlint.rule_finder import assert_valid_rule_class, find_rule_classes
from gitlint.rules import UserRuleError
from gitlint.tests.base import BaseTestCase
class UserRuleTests(BaseTestCase):
def test_find_rule_classes(self):
# Let's find some user... | sys.path) | self.assertIn | complex_expr | gitlint-core/gitlint/tests/rules/test_user_rules.py | test_find_rule_classes | UserRuleTests | 27 | null |
jorisroovers/gitlint | from gitlint.cache import PropertyCache, cache
from gitlint.tests.base import BaseTestCase
class CacheTests(BaseTestCase):
def test_cache(self):
# Init new class with cached properties
myclass = self.MyClass()
self.assertEqual(myclass.counter, 0)
self.assertDictEqual(myclass._cache... | 1) | self.assertEqual | numeric_literal | gitlint-core/gitlint/tests/test_cache.py | test_cache | CacheTests | 33 | null |
jorisroovers/gitlint | import os
import re
from gitlint.options import (
BoolOption,
IntOption,
ListOption,
PathOption,
RegexOption,
RuleOptionError,
StrOption,
)
from gitlint.tests.base import BaseTestCase
class RuleOptionTests(BaseTestCase):
def test_boolean_option(self):
# normal behavior
... | False) | self.assertEqual | bool_literal | gitlint-core/gitlint/tests/test_options.py | test_boolean_option | RuleOptionTests | 109 | null |
jorisroovers/gitlint | from gitlint.config import LintConfig
from gitlint.deprecation import Deprecation
from gitlint.rules import (
AuthorValidEmail,
IgnoreBodyLines,
IgnoreByAuthorName,
IgnoreByBody,
IgnoreByTitle,
)
from gitlint.tests.base import (
EXPECTED_REGEX_STYLE_SEARCH_DEPRECATION_WARNING,
BaseTestCase,
... | rule.options["regex"].value.search) | self.assertEqual | complex_expr | gitlint-core/gitlint/tests/test_deprecation.py | test_get_regex_method | DeprecationTests | 37 | null |
jorisroovers/gitlint | import os
import sys
from gitlint import options, rules
from gitlint.rule_finder import assert_valid_rule_class, find_rule_classes
from gitlint.rules import UserRuleError
from gitlint.tests.base import BaseTestCase
class UserRuleTests(BaseTestCase):
def test_empty_user_classes(self):
# Test that we don't... | []) | self.assertListEqual | collection | gitlint-core/gitlint/tests/rules/test_user_rules.py | test_empty_user_classes | UserRuleTests | 80 | null |
jorisroovers/gitlint | from unittest.mock import patch
from gitlint import options, rules
from gitlint.config import (
GITLINT_CONFIG_TEMPLATE_SRC_PATH,
LintConfig,
LintConfigError,
LintConfigGenerator,
)
from gitlint.tests.base import BaseTestCase
class LintConfigTests(BaseTestCase):
def test_ignore_independent_from_r... | original_rules) | self.assertSequenceEqual | variable | gitlint-core/gitlint/tests/config/test_config.py | test_ignore_independent_from_rules | LintConfigTests | 275 | null |
jorisroovers/gitlint | import os
from unittest.mock import call, patch
from gitlint.git import (
GitContext,
GitContextError,
GitNotInstalledError,
git_commentchar,
git_hooks_dir,
)
from gitlint.shell import CommandNotFound, ErrorReturnCode
from gitlint.tests.base import BaseTestCase
class GitTests(BaseTestCase):
e... | ";") | self.assertEqual | string_literal | gitlint-core/gitlint/tests/git/test_git.py | test_git_commentchar | GitTests | 111 | null |
jorisroovers/gitlint | import os
import re
from gitlint.options import (
BoolOption,
IntOption,
ListOption,
PathOption,
RegexOption,
RuleOptionError,
StrOption,
)
from gitlint.tests.base import BaseTestCase
class RuleOptionTests(BaseTestCase):
def test_str_option(self):
# normal behavior
opt... | "123") | self.assertEqual | string_literal | gitlint-core/gitlint/tests/test_options.py | test_str_option | RuleOptionTests | 90 | null |
jorisroovers/gitlint | import copy
import datetime
from pathlib import Path
from unittest.mock import call, patch
import arrow
import dateutil
from gitlint.git import (
GitChangedFileStats,
GitCommit,
GitCommitMessage,
GitContext,
GitContextError,
LocalGitCommit,
StagedLocalGitCommit,
)
from gitlint.shell import ... | []) | self.assertEqual | collection | gitlint-core/gitlint/tests/git/test_git_commit.py | test_get_latest_commit_merge_commit | GitCommitTests | 350 | null |
jorisroovers/gitlint | from collections import OrderedDict
from gitlint import rules
from gitlint.config import RuleCollection
from gitlint.tests.base import BaseTestCase
class RuleCollectionTests(BaseTestCase):
def test_add_find_rule(self):
collection = RuleCollection()
collection.add_rules([rules.TitleMaxLength, rule... | expected2) | self.assertEqual | variable | gitlint-core/gitlint/tests/config/test_rule_collection.py | test_add_find_rule | RuleCollectionTests | 37 | null |
jorisroovers/gitlint | from unittest.mock import call, patch
from gitlint.git import GitContext
from gitlint.tests.base import BaseTestCase
class GitContextTests(BaseTestCase):
expected_sh_special_args = {"_tty_out": False, "_cwd": "fåke/path"}
@patch("gitlint.git.sh")
def test_gitcontext(self, sh):
sh.git.side_effect... | "#") | self.assertEqual | string_literal | gitlint-core/gitlint/tests/git/test_git_context.py | test_gitcontext | GitContextTests | 24 | null |
jorisroovers/gitlint | import contextlib
import copy
import logging
import os
import re
import shutil
import tempfile
import unittest
from pathlib import Path
from typing import Any, Dict, Optional
from unittest.mock import patch
from gitlint.config import LintConfig
from gitlint.deprecation import LOG as DEPRECATION_LOG
from gitlint.deprec... | self.logcapture.messages) | self.assertIn | complex_expr | gitlint-core/gitlint/tests/base.py | assert_log_contains | BaseTestCase | 156 | null |
jorisroovers/gitlint | from collections import OrderedDict
from gitlint import rules
from gitlint.config import RuleCollection
from gitlint.tests.base import BaseTestCase
class RuleCollectionTests(BaseTestCase):
def test_add_find_rule(self):
collection = RuleCollection()
collection.add_rules([rules.TitleMaxLength, rule... | "föo") | self.assertEqual | string_literal | gitlint-core/gitlint/tests/config/test_rule_collection.py | test_add_find_rule | RuleCollectionTests | 32 | null |
jorisroovers/gitlint | from gitlint import rules
from gitlint.config import LintConfig
from gitlint.tests.base import (
BaseTestCase,
)
class ConfigurationRuleTests(BaseTestCase):
def test_ignore_body_lines(self):
commit1 = self.gitcommit("Tïtle\n\nThis is\n a relëase body\n line")
commit2 = self.gitcommit("Tïtle\n\... | commit2) | self.assertEqual | variable | gitlint-core/gitlint/tests/rules/test_configuration_rules.py | test_ignore_body_lines | ConfigurationRuleTests | 147 | null |
jorisroovers/gitlint | from unittest.mock import patch
from gitlint import options, rules
from gitlint.config import (
GITLINT_CONFIG_TEMPLATE_SRC_PATH,
LintConfig,
LintConfigError,
LintConfigGenerator,
)
from gitlint.tests.base import BaseTestCase
class LintConfigTests(BaseTestCase):
def test_set_general_option(self):... | config.debug) | self.assertFalse | complex_expr | gitlint-core/gitlint/tests/config/test_config.py | test_set_general_option | LintConfigTests | 59 | null |
jorisroovers/gitlint | import copy
from gitlint import rules
from gitlint.config import LintConfig, LintConfigBuilder, LintConfigError
from gitlint.tests.base import BaseTestCase
class LintConfigBuilderTests(BaseTestCase):
def test_set_from_commit_ignore_all(self):
config = LintConfig()
original_rules = config.rules
... | []) | self.assertListEqual | collection | gitlint-core/gitlint/tests/config/test_config_builder.py | test_set_from_commit_ignore_all | LintConfigBuilderTests | 48 | null |
jorisroovers/gitlint | import os
import re
from gitlint.options import (
BoolOption,
IntOption,
ListOption,
PathOption,
RegexOption,
RuleOptionError,
StrOption,
)
from gitlint.tests.base import BaseTestCase
class RuleOptionTests(BaseTestCase):
def test_int_option(self):
# normal behavior
opt... | -456) | self.assertEqual | numeric_literal | gitlint-core/gitlint/tests/test_options.py | test_int_option | RuleOptionTests | 70 | null |
jorisroovers/gitlint | from io import StringIO
from unittest.mock import patch
from gitlint.config import LintConfig, LintConfigBuilder
from gitlint.lint import GitLinter
from gitlint.rules import RuleViolation, TitleMustNotContainWord
from gitlint.tests.base import BaseTestCase
class LintTests(BaseTestCase):
def test_ignore_named_rul... | linter.lint(commit)) | self.assertListEqual | func_call | gitlint-core/gitlint/tests/test_lint.py | test_ignore_named_rules | LintTests | 284 | null |
jorisroovers/gitlint | import re
import arrow
from qa.base import BaseTestCase
from qa.shell import echo, git, gitlint
class CommitsTests(BaseTestCase):
def test_lint_single_commit(self):
"""Tests `gitlint --commits <sha>^...<same sha>`"""
self.create_simple_commit("Sïmple title.\n")
first_commit_sha = self.ge... | 254) | self.assertEqual | numeric_literal | qa/test_commits.py | test_lint_single_commit | CommitsTests | 133 | null |
jorisroovers/gitlint | from collections import OrderedDict
from gitlint import rules
from gitlint.config import RuleCollection
from gitlint.tests.base import BaseTestCase
class RuleCollectionTests(BaseTestCase):
def test_delete_rules_by_attr(self):
collection = RuleCollection()
collection.add_rules([rules.TitleMaxLengt... | expected_rule) | self.assertEqual | variable | gitlint-core/gitlint/tests/config/test_rule_collection.py | test_delete_rules_by_attr | RuleCollectionTests | 52 | null |
jorisroovers/gitlint | import copy
import datetime
from pathlib import Path
from unittest.mock import call, patch
import arrow
import dateutil
from gitlint.git import (
GitChangedFileStats,
GitCommit,
GitCommitMessage,
GitContext,
GitContextError,
LocalGitCommit,
StagedLocalGitCommit,
)
from gitlint.shell import ... | 1) | self.assertEqual | numeric_literal | gitlint-core/gitlint/tests/git/test_git_commit.py | test_from_commit_msg_full | GitCommitTests | 496 | null |
jorisroovers/gitlint | import copy
from gitlint import rules
from gitlint.config import LintConfig, LintConfigBuilder, LintConfigError
from gitlint.tests.base import BaseTestCase
class LintConfigBuilderTests(BaseTestCase):
def test_set_config_from_string_list(self):
config = LintConfig()
# change and assert changes
... | 60) | self.assertEqual | numeric_literal | gitlint-core/gitlint/tests/config/test_config_builder.py | test_set_config_from_string_list | LintConfigBuilderTests | 154 | null |
jorisroovers/gitlint | import re
import arrow
from qa.base import BaseTestCase
from qa.shell import echo, git, gitlint
class CommitsTests(BaseTestCase):
def test_lint_staged_stdin(self):
"""Tests linting a staged commit. Gitint should lint the passed commit message and fetch additional meta-data
from the underlying re... | 3) | self.assertEqual | numeric_literal | qa/test_commits.py | test_lint_staged_stdin | CommitsTests | 182 | null |
jorisroovers/gitlint | from gitlint.rules import (
RuleViolation,
TitleHardTab,
TitleLeadingWhitespace,
TitleMaxLength,
TitleMinLength,
TitleMustNotContainWord,
TitleRegexMatches,
TitleTrailingPunctuation,
TitleTrailingWhitespace,
)
from gitlint.tests.base import BaseTestCase
class TitleRuleTests(BaseTest... | violations) | self.assertIsNone | variable | gitlint-core/gitlint/tests/rules/test_title_rules.py | test_max_line_length | TitleRuleTests | 31 | null |
jorisroovers/gitlint | import os
import sys
from gitlint import options, rules
from gitlint.rule_finder import assert_valid_rule_class, find_rule_classes
from gitlint.rules import UserRuleError
from gitlint.tests.base import BaseTestCase
class UserRuleTests(BaseTestCase):
def test_find_rule_classes(self):
# Let's find some user... | "UC1") | self.assertEqual | string_literal | gitlint-core/gitlint/tests/rules/test_user_rules.py | test_find_rule_classes | UserRuleTests | 31 | null |
jorisroovers/gitlint | import os
import re
from gitlint.options import (
BoolOption,
IntOption,
ListOption,
PathOption,
RegexOption,
RuleOptionError,
StrOption,
)
from gitlint.tests.base import BaseTestCase
class RuleOptionTests(BaseTestCase):
def test_option_equality(self):
options = {
... | option2) | self.assertEqual | variable | gitlint-core/gitlint/tests/test_options.py | test_option_equality | RuleOptionTests | 34 | null |
jorisroovers/gitlint | from unittest.mock import patch
from gitlint import options, rules
from gitlint.config import (
GITLINT_CONFIG_TEMPLATE_SRC_PATH,
LintConfig,
LintConfigError,
LintConfigGenerator,
)
from gitlint.tests.base import BaseTestCase
class LintConfigTests(BaseTestCase):
def test_set_general_option(self):... | 1) | self.assertEqual | numeric_literal | gitlint-core/gitlint/tests/config/test_config.py | test_set_general_option | LintConfigTests | 74 | null |
jorisroovers/gitlint | from collections import OrderedDict
from gitlint import rules
from gitlint.config import RuleCollection
from gitlint.tests.base import BaseTestCase
class RuleCollectionTests(BaseTestCase):
def test_add_rule(self):
collection = RuleCollection()
collection.add_rule(rules.TitleMaxLength, "my-rüle", {... | expected.my_attr2) | self.assertEqual | complex_expr | gitlint-core/gitlint/tests/config/test_rule_collection.py | test_add_rule | RuleCollectionTests | 22 | null |
jorisroovers/gitlint | from gitlint.config import LintConfig
from gitlint.contrib.rules.signedoff_by import SignedOffBy
from gitlint.rules import RuleViolation
from gitlint.tests.base import BaseTestCase
class ContribSignedOffByTests(BaseTestCase):
def test_signedoff_by(self):
# No violations when 'Signed-off-by' line is presen... | [expected_violation]) | self.assertListEqual | collection | gitlint-core/gitlint/tests/contrib/rules/test_signedoff_by.py | test_signedoff_by | ContribSignedOffByTests | 24 | null |
jorisroovers/gitlint | from gitlint.rules import AuthorValidEmail, RuleViolation
from gitlint.tests.base import (
BaseTestCase,
)
class MetaRuleTests(BaseTestCase):
def test_author_valid_email_rule(self):
rule = AuthorValidEmail()
# valid email addresses
valid_email_addresses = [
"föo@bar.com",
... | [RuleViolation("M1", "Author email for commit is invalid", email)]) | self.assertListEqual | collection | gitlint-core/gitlint/tests/rules/test_meta_rules.py | test_author_valid_email_rule | MetaRuleTests | 46 | null |
jorisroovers/gitlint | from gitlint.rules import Rule, RuleViolation
from gitlint.tests.base import BaseTestCase
class RuleTests(BaseTestCase):
def test_ruleviolation__str__(self):
expected = '57: rule-ïd Tēst message: "Tēst content"'
self.assertEqual(str(RuleViolation("rule-ïd", "Tēst message", "Tēst content", 57)), ex... | expected) | self.assertEqual | variable | gitlint-core/gitlint/tests/rules/test_rules.py | test_ruleviolation__str__ | RuleTests | 8 | null |
jorisroovers/gitlint | import os
from gitlint import rule_finder, rules
from gitlint.contrib import rules as contrib_rules
from gitlint.tests.base import BaseTestCase
from gitlint.tests.contrib import rules as contrib_tests
class ContribRuleTests(BaseTestCase):
CONTRIB_DIR = os.path.dirname(os.path.realpath(contrib_rules.__file__))
... | error_msg) | self.assertIn | variable | gitlint-core/gitlint/tests/contrib/test_contrib_rules.py | test_contrib_tests_exist | ContribRuleTests | 28 | null |
jorisroovers/gitlint | import os
from unittest.mock import ANY, mock_open, patch
from gitlint.config import LintConfig
from gitlint.hooks import (
COMMIT_MSG_HOOK_DST_PATH,
COMMIT_MSG_HOOK_SRC_PATH,
GITLINT_HOOK_IDENTIFIER,
GitHookInstaller,
GitHookInstallerError,
)
from gitlint.tests.base import BaseTestCase
class Hook... | expected_path) | self.assertEqual | variable | gitlint-core/gitlint/tests/test_hooks.py | test_commit_msg_hook_path | HookTests | 25 | null |
jorisroovers/gitlint | from unittest.mock import patch
from gitlint import options, rules
from gitlint.config import (
GITLINT_CONFIG_TEMPLATE_SRC_PATH,
LintConfig,
LintConfigError,
LintConfigGenerator,
)
from gitlint.tests.base import BaseTestCase
class LintConfigTests(BaseTestCase):
def test_contrib(self):
co... | []) | self.assertListEqual | collection | gitlint-core/gitlint/tests/config/test_config.py | test_contrib | LintConfigTests | 162 | null |
jorisroovers/gitlint | from collections import namedtuple
from unittest.mock import patch
from gitlint.config import LintConfig
from gitlint.contrib.rules.authors_commit import AllowedAuthors
from gitlint.rules import RuleViolation
from gitlint.tests.base import BaseTestCase
class ContribAuthorsCommitTests(BaseTestCase):
def setUp(self... | {self.author_1}) | self.assertEqual | collection | gitlint-core/gitlint/tests/contrib/rules/test_authors_commit.py | test_read_authors_file | ContribAuthorsCommitTests | 97 | null |
jorisroovers/gitlint | import os
import re
from gitlint.options import (
BoolOption,
IntOption,
ListOption,
PathOption,
RegexOption,
RuleOptionError,
StrOption,
)
from gitlint.tests.base import BaseTestCase
class RuleOptionTests(BaseTestCase):
def test_boolean_option(self):
# normal behavior
... | True) | self.assertEqual | bool_literal | gitlint-core/gitlint/tests/test_options.py | test_boolean_option | RuleOptionTests | 105 | null |
jorisroovers/gitlint | import os
from qa.base import BaseTestCase
from qa.shell import echo, git, gitlint
from qa.utils import FILE_ENCODING
class IntegrationTests(BaseTestCase):
def test_successful_merge_commit(self):
# Create branch on main
self.create_simple_commit("Cömmit on main\n\nSimple bödy")
# Create ... | 1) | self.assertEqual | numeric_literal | qa/test_gitlint.py | test_successful_merge_commit | IntegrationTests | 50 | null |
jorisroovers/gitlint | from gitlint.config import LintConfig
from gitlint.contrib.rules.signedoff_by import SignedOffBy
from gitlint.rules import RuleViolation
from gitlint.tests.base import BaseTestCase
class ContribSignedOffByTests(BaseTestCase):
def test_enable(self):
# Test that rule can be enabled in config
for rule... | config.rules) | self.assertIn | complex_expr | gitlint-core/gitlint/tests/contrib/rules/test_signedoff_by.py | test_enable | ContribSignedOffByTests | 13 | null |
jorisroovers/gitlint | import os
import sys
from gitlint import options, rules
from gitlint.rule_finder import assert_valid_rule_class, find_rule_classes
from gitlint.rules import UserRuleError
from gitlint.tests.base import BaseTestCase
class UserRuleTests(BaseTestCase):
def test_assert_valid_rule_class_negative_target(self):
... | MyRuleClass) | assert_* | variable | gitlint-core/gitlint/tests/rules/test_user_rules.py | test_assert_valid_rule_class_negative_target | UserRuleTests | 257 | null |
jorisroovers/gitlint | from unittest.mock import patch
from gitlint import options, rules
from gitlint.config import (
GITLINT_CONFIG_TEMPLATE_SRC_PATH,
LintConfig,
LintConfigError,
LintConfigGenerator,
)
from gitlint.tests.base import BaseTestCase
class LintConfigTests(BaseTestCase):
def test_ignore_independent_from_r... | ["T1", "T2"]) | self.assertEqual | collection | gitlint-core/gitlint/tests/config/test_config.py | test_ignore_independent_from_rules | LintConfigTests | 274 | null |
jorisroovers/gitlint | import copy
from gitlint import rules
from gitlint.config import LintConfig, LintConfigBuilder, LintConfigError
from gitlint.tests.base import BaseTestCase
class LintConfigBuilderTests(BaseTestCase):
def test_set_option(self):
config_builder = LintConfigBuilder()
config = config_builder.build()
... | 80) | self.assertEqual | numeric_literal | gitlint-core/gitlint/tests/config/test_config_builder.py | test_set_option | LintConfigBuilderTests | 15 | null |
jorisroovers/gitlint | import os
from unittest.mock import ANY, mock_open, patch
from gitlint.config import LintConfig
from gitlint.hooks import (
COMMIT_MSG_HOOK_DST_PATH,
COMMIT_MSG_HOOK_SRC_PATH,
GITLINT_HOOK_IDENTIFIER,
GitHookInstaller,
GitHookInstallerError,
)
from gitlint.tests.base import BaseTestCase
class Hook... | expected_dst) | assert_* | variable | gitlint-core/gitlint/tests/test_hooks.py | test_install_commit_msg_hook | HookTests | 41 | null |
jorisroovers/gitlint | import os
import platform
import sys
from io import StringIO
from unittest.mock import patch
import arrow
from click.testing import CliRunner
from gitlint import __version__, cli
from gitlint.shell import CommandNotFound
from gitlint.tests.base import BaseTestCase
from gitlint.utils import FILE_ENCODING, TERMINAL_ENCO... | 0) | self.assertEqual | numeric_literal | gitlint-core/gitlint/tests/cli/test_cli.py | test_lint_ignore_stdin | CLITests | 304 | null |
jorisroovers/gitlint | from collections import OrderedDict
from gitlint import rules
from gitlint.config import RuleCollection
from gitlint.tests.base import BaseTestCase
class RuleCollectionTests(BaseTestCase):
def test_add_rule(self):
collection = RuleCollection()
collection.add_rule(rules.TitleMaxLength, "my-rüle", {... | expected.my_attr) | self.assertEqual | complex_expr | gitlint-core/gitlint/tests/config/test_rule_collection.py | test_add_rule | RuleCollectionTests | 21 | null |
jorisroovers/gitlint | import os
import sys
from gitlint import options, rules
from gitlint.rule_finder import assert_valid_rule_class, find_rule_classes
from gitlint.rules import UserRuleError
from gitlint.tests.base import BaseTestCase
class UserRuleTests(BaseTestCase):
def test_find_rule_classes(self):
# Let's find some user... | sys.modules) | self.assertIn | complex_expr | gitlint-core/gitlint/tests/rules/test_user_rules.py | test_find_rule_classes | UserRuleTests | 28 | null |
jorisroovers/gitlint | from io import StringIO
from unittest.mock import patch
from click.testing import CliRunner
from gitlint import cli
from gitlint.config import LintConfigBuilder
from gitlint.tests.base import BaseTestCase
class LintConfigPrecedenceTests(BaseTestCase):
def setUp(self):
super().setUp()
self.cli = Cl... | 1) | self.assertEqual | numeric_literal | gitlint-core/gitlint/tests/config/test_config_precedence.py | test_ignore_precedence | LintConfigPrecedenceTests | 65 | null |
jorisroovers/gitlint | import os
from unittest.mock import ANY, mock_open, patch
from gitlint.config import LintConfig
from gitlint.hooks import (
COMMIT_MSG_HOOK_DST_PATH,
COMMIT_MSG_HOOK_SRC_PATH,
GITLINT_HOOK_IDENTIFIER,
GitHookInstaller,
GitHookInstallerError,
)
from gitlint.tests.base import BaseTestCase
class Hook... | lint_config.target) | assert_* | complex_expr | gitlint-core/gitlint/tests/test_hooks.py | test_install_commit_msg_hook | HookTests | 45 | null |
jorisroovers/gitlint | from collections import namedtuple
from unittest.mock import patch
from gitlint.config import LintConfig
from gitlint.contrib.rules.authors_commit import AllowedAuthors
from gitlint.rules import RuleViolation
from gitlint.tests.base import BaseTestCase
class ContribAuthorsCommitTests(BaseTestCase):
def setUp(self... | config.rules) | self.assertIn | complex_expr | gitlint-core/gitlint/tests/contrib/rules/test_authors_commit.py | test_enable | ContribAuthorsCommitTests | 32 | null |
jorisroovers/gitlint | from gitlint.config import LintConfig
from gitlint.contrib.rules.conventional_commit import ConventionalCommit
from gitlint.rules import RuleViolation
from gitlint.tests.base import BaseTestCase
class ContribConventionalCommitTests(BaseTestCase):
def test_conventional_commits(self):
rule = ConventionalCom... | violations) | self.assertListEqual | variable | gitlint-core/gitlint/tests/contrib/rules/test_conventional_commit.py | test_conventional_commits | ContribConventionalCommitTests | 30 | null |
jorisroovers/gitlint | import os
from io import StringIO
from unittest.mock import patch
from click.testing import CliRunner
from gitlint import cli, config, hooks
from gitlint.shell import ErrorReturnCode
from gitlint.tests.base import BaseTestCase
from gitlint.utils import FILE_ENCODING
class CLIHookTests(BaseTestCase):
USAGE_ERROR_C... | 2) | self.assertEqual | numeric_literal | gitlint-core/gitlint/tests/cli/test_cli_hooks.py | test_run_hook_local_commit | CLIHookTests | 277 | null |
jorisroovers/gitlint | from collections import namedtuple
from unittest.mock import patch
from gitlint.config import LintConfig
from gitlint.contrib.rules.authors_commit import AllowedAuthors
from gitlint.rules import RuleViolation
from gitlint.tests.base import BaseTestCase
class ContribAuthorsCommitTests(BaseTestCase):
def setUp(self... | 1) | self.assertEqual | numeric_literal | gitlint-core/gitlint/tests/contrib/rules/test_authors_commit.py | test_read_authors_file | ContribAuthorsCommitTests | 96 | null |
jorisroovers/gitlint | import os
from io import StringIO
from unittest.mock import patch
from click.testing import CliRunner
from gitlint import cli, config, hooks
from gitlint.shell import ErrorReturnCode
from gitlint.tests.base import BaseTestCase
from gitlint.utils import FILE_ENCODING
class CLIHookTests(BaseTestCase):
USAGE_ERROR_C... | 0) | self.assertEqual | numeric_literal | gitlint-core/gitlint/tests/cli/test_cli_hooks.py | test_install_hook | CLIHookTests | 37 | null |
jorisroovers/gitlint | from unittest.mock import patch
from gitlint import utils
from gitlint.tests.base import BaseTestCase
class UtilsTests(BaseTestCase):
def tearDown(self):
# Since we're messing around with `utils.PLATFORM_IS_WINDOWS` during these tests, we need to reset
# its value after we're done this doesn't inf... | "foöbar") | self.assertEqual | string_literal | gitlint-core/gitlint/tests/test_utils.py | test_terminal_encoding_non_windows | UtilsTests | 17 | null |
jorisroovers/gitlint | from collections import namedtuple
from unittest.mock import patch
from gitlint.config import LintConfig
from gitlint.contrib.rules.authors_commit import AllowedAuthors
from gitlint.rules import RuleViolation
from gitlint.tests.base import BaseTestCase
class ContribAuthorsCommitTests(BaseTestCase):
def setUp(self... | "AUTHORS") | self.assertEqual | string_literal | gitlint-core/gitlint/tests/contrib/rules/test_authors_commit.py | test_read_authors_file | ContribAuthorsCommitTests | 95 | null |
jorisroovers/gitlint | from gitlint.rules import (
RuleViolation,
TitleHardTab,
TitleLeadingWhitespace,
TitleMaxLength,
TitleMinLength,
TitleMustNotContainWord,
TitleRegexMatches,
TitleTrailingPunctuation,
TitleTrailingWhitespace,
)
from gitlint.tests.base import BaseTestCase
class TitleRuleTests(BaseTest... | [expected_violation]) | self.assertListEqual | collection | gitlint-core/gitlint/tests/rules/test_title_rules.py | test_max_line_length | TitleRuleTests | 26 | null |
jorisroovers/gitlint | from unittest.mock import patch
from gitlint import options, rules
from gitlint.config import (
GITLINT_CONFIG_TEMPLATE_SRC_PATH,
LintConfig,
LintConfigError,
LintConfigGenerator,
)
from gitlint.tests.base import BaseTestCase
class LintConfigTests(BaseTestCase):
def test_contrib(self):
co... | "CT1") | self.assertEqual | string_literal | gitlint-core/gitlint/tests/config/test_config.py | test_contrib | LintConfigTests | 134 | null |
jorisroovers/gitlint | from gitlint.config import LintConfig
from gitlint.contrib.rules.conventional_commit import ConventionalCommit
from gitlint.rules import RuleViolation
from gitlint.tests.base import BaseTestCase
class ContribConventionalCommitTests(BaseTestCase):
def test_enable(self):
# Test that rule can be enabled in co... | config.rules) | self.assertIn | complex_expr | gitlint-core/gitlint/tests/contrib/rules/test_conventional_commit.py | test_enable | ContribConventionalCommitTests | 13 | null |
jorisroovers/gitlint | import os
from qa.base import BaseTestCase
from qa.shell import git, gitlint
class HookTests(BaseTestCase):
VIOLATIONS = [
"gitlint: checking commit message...\n",
'1: T3 Title has trailing punctuation (.): "WIP: This ïs a title."\n',
"1: T5 Title contains the word 'WIP' (case-insensitive... | expected.replace("\r", "")) | self.assertMultiLineEqual | func_call | qa/test_hooks.py | test_commit_hook_no_violations | HookTests | 75 | null |
jorisroovers/gitlint | from io import StringIO
from unittest.mock import patch
from gitlint.config import LintConfig, LintConfigBuilder
from gitlint.lint import GitLinter
from gitlint.rules import RuleViolation, TitleMustNotContainWord
from gitlint.tests.base import BaseTestCase
class LintTests(BaseTestCase):
def test_print_violations... | stderr.getvalue()) | self.assertEqual | func_call | gitlint-core/gitlint/tests/test_lint.py | test_print_violations | LintTests | 228 | null |
jorisroovers/gitlint | from unittest.mock import patch
from gitlint import utils
from gitlint.tests.base import BaseTestCase
class UtilsTests(BaseTestCase):
def tearDown(self):
# Since we're messing around with `utils.PLATFORM_IS_WINDOWS` during these tests, we need to reset
# its value after we're done this doesn't inf... | "UTF-8") | self.assertEqual | string_literal | gitlint-core/gitlint/tests/test_utils.py | test_terminal_encoding_non_windows | UtilsTests | 21 | null |
jorisroovers/gitlint | import copy
from gitlint import rules
from gitlint.config import LintConfig, LintConfigBuilder, LintConfigError
from gitlint.tests.base import BaseTestCase
class LintConfigBuilderTests(BaseTestCase):
def test_set_from_config_file(self):
# regular config file load, no problems
config_builder = Lin... | 30) | self.assertEqual | numeric_literal | gitlint-core/gitlint/tests/config/test_config_builder.py | test_set_from_config_file | LintConfigBuilderTests | 86 | null |
jorisroovers/gitlint | import os
import platform
import sys
from io import StringIO
from unittest.mock import patch
import arrow
from click.testing import CliRunner
from gitlint import __version__, cli
from gitlint.shell import CommandNotFound
from gitlint.tests.base import BaseTestCase
from gitlint.utils import FILE_ENCODING, TERMINAL_ENCO... | 1) | self.assertEqual | numeric_literal | gitlint-core/gitlint/tests/cli/test_cli.py | test_lint_ignore_stdin | CLITests | 301 | null |
jorisroovers/gitlint | import copy
from gitlint import rules
from gitlint.config import LintConfig, LintConfigBuilder, LintConfigError
from gitlint.tests.base import BaseTestCase
class LintConfigBuilderTests(BaseTestCase):
def test_set_from_config_file(self):
# regular config file load, no problems
config_builder = Lin... | config.debug) | self.assertFalse | complex_expr | gitlint-core/gitlint/tests/config/test_config_builder.py | test_set_from_config_file | LintConfigBuilderTests | 80 | null |
jorisroovers/gitlint | import os
import sys
from gitlint import options, rules
from gitlint.rule_finder import assert_valid_rule_class, find_rule_classes
from gitlint.rules import UserRuleError
from gitlint.tests.base import BaseTestCase
class UserRuleTests(BaseTestCase):
def test_rules_from_init_file(self):
# Test that we can... | expected) | self.assertListEqual | variable | gitlint-core/gitlint/tests/rules/test_user_rules.py | test_rules_from_init_file | UserRuleTests | 74 | null |
jorisroovers/gitlint | from gitlint import rules
from gitlint.config import LintConfig
from gitlint.tests.base import (
BaseTestCase,
)
class ConfigurationRuleTests(BaseTestCase):
def test_ignore_by_title(self):
commit = self.gitcommit("Releäse\n\nThis is the secōnd body line")
# No regex specified -> Config shouldn... | LintConfig()) | self.assertEqual | func_call | gitlint-core/gitlint/tests/rules/test_configuration_rules.py | test_ignore_by_title | ConfigurationRuleTests | 16 | null |
jorisroovers/gitlint | from io import StringIO
from unittest.mock import patch
from gitlint.config import LintConfig, LintConfigBuilder
from gitlint.lint import GitLinter
from gitlint.rules import RuleViolation, TitleMustNotContainWord
from gitlint.tests.base import BaseTestCase
class LintTests(BaseTestCase):
def test_lint_sample1(self... | expected_errors) | self.assertListEqual | variable | gitlint-core/gitlint/tests/test_lint.py | test_lint_sample1 | LintTests | 32 | null |
jorisroovers/gitlint | import os
from unittest.mock import call, patch
from gitlint.git import (
GitContext,
GitContextError,
GitNotInstalledError,
git_commentchar,
git_hooks_dir,
)
from gitlint.shell import CommandNotFound, ErrorReturnCode
from gitlint.tests.base import BaseTestCase
class GitTests(BaseTestCase):
e... | os.path.abspath(os.path.join("/blä", hooks_dir))) | self.assertEqual | func_call | gitlint-core/gitlint/tests/git/test_git.py | test_git_hooks_dir | GitTests | 119 | null |
jorisroovers/gitlint | from io import StringIO
from unittest.mock import patch
from click.testing import CliRunner
from gitlint import cli
from gitlint.config import LintConfigBuilder
from gitlint.tests.base import BaseTestCase
class LintConfigPrecedenceTests(BaseTestCase):
def setUp(self):
super().setUp()
self.cli = Cl... | "") | self.assertEqual | string_literal | gitlint-core/gitlint/tests/config/test_config_precedence.py | test_config_precedence | LintConfigPrecedenceTests | 30 | null |
jorisroovers/gitlint | import os
import re
from gitlint.options import (
BoolOption,
IntOption,
ListOption,
PathOption,
RegexOption,
RuleOptionError,
StrOption,
)
from gitlint.tests.base import BaseTestCase
class RuleOptionTests(BaseTestCase):
def test_list_option(self):
# normal behavior
op... | ["123"]) | self.assertListEqual | collection | gitlint-core/gitlint/tests/test_options.py | test_list_option | RuleOptionTests | 166 | null |
jorisroovers/gitlint | import os
import re
from gitlint.options import (
BoolOption,
IntOption,
ListOption,
PathOption,
RegexOption,
RuleOptionError,
StrOption,
)
from gitlint.tests.base import BaseTestCase
class RuleOptionTests(BaseTestCase):
def test_int_option(self):
# normal behavior
opt... | 456) | self.assertEqual | numeric_literal | gitlint-core/gitlint/tests/test_options.py | test_int_option | RuleOptionTests | 51 | null |
jorisroovers/gitlint | import os
import platform
import sys
from io import StringIO
from unittest.mock import patch
import arrow
from click.testing import CliRunner
from gitlint import __version__, cli
from gitlint.shell import CommandNotFound
from gitlint.tests.base import BaseTestCase
from gitlint.utils import FILE_ENCODING, TERMINAL_ENCO... | 3) | self.assertEqual | numeric_literal | gitlint-core/gitlint/tests/cli/test_cli.py | test_lint_multiple_commits | CLITests | 99 | null |
jorisroovers/gitlint | from unittest.mock import patch
from gitlint import options, rules
from gitlint.config import (
GITLINT_CONFIG_TEMPLATE_SRC_PATH,
LintConfig,
LintConfigError,
LintConfigGenerator,
)
from gitlint.tests.base import BaseTestCase
class LintConfigTests(BaseTestCase):
def test_set_rule_option(self):
... | 72) | self.assertEqual | numeric_literal | gitlint-core/gitlint/tests/config/test_config.py | test_set_rule_option | LintConfigTests | 18 | null |
jorisroovers/gitlint | from gitlint.config import LintConfig
from gitlint.contrib.rules.disallow_cleanup_commits import DisallowCleanupCommits
from gitlint.rules import RuleViolation
from gitlint.tests.base import BaseTestCase
class ContribDisallowCleanupCommitsTest(BaseTestCase):
def test_disallow_fixup_squash_commit(self):
# ... | []) | self.assertListEqual | collection | gitlint-core/gitlint/tests/contrib/rules/test_disallow_cleanup_commits.py | test_disallow_fixup_squash_commit | ContribDisallowCleanupCommitsTest | 19 | null |
jorisroovers/gitlint | import os
import re
from gitlint.options import (
BoolOption,
IntOption,
ListOption,
PathOption,
RegexOption,
RuleOptionError,
StrOption,
)
from gitlint.tests.base import BaseTestCase
class RuleOptionTests(BaseTestCase):
def test_path_option(self):
option = PathOption("tëst-di... | "dir") | self.assertEqual | string_literal | gitlint-core/gitlint/tests/test_options.py | test_path_option | RuleOptionTests | 173 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.