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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/contrib/rules/test_conventional_commit.py | test_conventional_commits | self.assertListEqual | variable | 21 | from gitlint.tests.base import BaseTestCase
from gitlint.rules import RuleViolation
from gitlint.contrib.rules.conventional_commit import ConventionalCommit
from gitlint.config import LintConfig
class ContribConventionalCommitTests(BaseTestCase):
def test_conventional_commits(self):
rule = ConventionalCom... | violations) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/contrib/rules/test_conventional_commit.py | test_enable | self.assertIn | complex_expr | 14 | from gitlint.tests.base import BaseTestCase
from gitlint.rules import RuleViolation
from gitlint.contrib.rules.conventional_commit import ConventionalCommit
from gitlint.config import LintConfig
class ContribConventionalCommitTests(BaseTestCase):
def test_enable(self):
# Test that rule can be enabled in c... | config.rules) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/contrib/rules/test_signedoff_by.py | test_signedoff_by | self.assertListEqual | variable | 14 | from gitlint.tests.base import BaseTestCase
from gitlint.rules import RuleViolation
from gitlint.contrib.rules.signedoff_by import SignedOffBy
from gitlint.config import LintConfig
class ContribSignedOffByTests(BaseTestCase):
def test_signedoff_by(self):
# No violations when 'Signed-off-by' line is prese... | violations) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/contrib/rules/test_signedoff_by.py | test_enable | self.assertIn | complex_expr | 15 | from gitlint.tests.base import BaseTestCase
from gitlint.rules import RuleViolation
from gitlint.contrib.rules.signedoff_by import SignedOffBy
from gitlint.config import LintConfig
class ContribSignedOffByTests(BaseTestCase):
def test_enable(self):
# Test that rule can be enabled in config
for ru... | config.rules) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/contrib/rules/test_signedoff_by.py | test_signedoff_by | self.assertListEqual | collection | 19 | from gitlint.tests.base import BaseTestCase
from gitlint.rules import RuleViolation
from gitlint.contrib.rules.signedoff_by import SignedOffBy
from gitlint.config import LintConfig
class ContribSignedOffByTests(BaseTestCase):
def test_signedoff_by(self):
# No violations when 'Signed-off-by' line is prese... | [expected_violation]) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/contrib/test_contrib_rules.py | test_contrib_tests_exist | self.assertIn | variable | 27 | import os
from gitlint.tests.base import BaseTestCase
from gitlint.contrib import rules as contrib_rules
from gitlint.tests.contrib import rules as contrib_tests
from gitlint import rule_finder, rules
class ContribRuleTests(BaseTestCase):
CONTRIB_DIR = os.path.dirname(os.path.realpath(contrib_rules.__file__))
... | error_msg) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/contrib/test_contrib_rules.py | test_contrib_rule_uniqueness | self.assertEqual | func_call | 25 | import os
from gitlint.tests.base import BaseTestCase
from gitlint.contrib import rules as contrib_rules
from gitlint.tests.contrib import rules as contrib_tests
from gitlint import rule_finder, rules
class ContribRuleTests(BaseTestCase):
CONTRIB_DIR = os.path.dirname(os.path.realpath(contrib_rules.__file__))
... | len(class_ids)) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/contrib/test_contrib_rules.py | test_contrib_rule_uniqueness | self.assertEqual | func_call | 24 | import os
from gitlint.tests.base import BaseTestCase
from gitlint.contrib import rules as contrib_rules
from gitlint.tests.contrib import rules as contrib_tests
from gitlint import rule_finder, rules
class ContribRuleTests(BaseTestCase):
CONTRIB_DIR = os.path.dirname(os.path.realpath(contrib_rules.__file__))
... | len(class_names)) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/contrib/test_contrib_rules.py | test_contrib_rule_naming_conventions | self.assertTrue | func_call | 28 | import os
from gitlint.tests.base import BaseTestCase
from gitlint.contrib import rules as contrib_rules
from gitlint.tests.contrib import rules as contrib_tests
from gitlint import rule_finder, rules
class ContribRuleTests(BaseTestCase):
CONTRIB_DIR = os.path.dirname(os.path.realpath(contrib_rules.__file__))
... | clazz.id.startswith("CT")) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/contrib/test_contrib_rules.py | test_contrib_rule_naming_conventions | self.assertTrue | func_call | 30 | import os
from gitlint.tests.base import BaseTestCase
from gitlint.contrib import rules as contrib_rules
from gitlint.tests.contrib import rules as contrib_tests
from gitlint import rule_finder, rules
class ContribRuleTests(BaseTestCase):
CONTRIB_DIR = os.path.dirname(os.path.realpath(contrib_rules.__file__))
... | clazz.id.startswith("CB")) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/contrib/test_contrib_rules.py | test_contrib_rule_naming_conventions | self.assertTrue | func_call | 23 | import os
from gitlint.tests.base import BaseTestCase
from gitlint.contrib import rules as contrib_rules
from gitlint.tests.contrib import rules as contrib_tests
from gitlint import rule_finder, rules
class ContribRuleTests(BaseTestCase):
CONTRIB_DIR = os.path.dirname(os.path.realpath(contrib_rules.__file__))
... | clazz.name.startswith("contrib-")) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/git/test_git.py | test_git_commentchar | self.assertEqual | string_literal | 21 | import os
from unittest.mock import patch
from gitlint.shell import ErrorReturnCode, CommandNotFound
from gitlint.tests.base import BaseTestCase
from gitlint.git import GitContext, GitContextError, GitNotInstalledError, git_commentchar, git_hooks_dir
class GitTests(BaseTestCase):
expected_sh_special_args = {
... | "#") | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/git/test_git.py | test_git_commentchar | self.assertEqual | string_literal | 25 | import os
from unittest.mock import patch
from gitlint.shell import ErrorReturnCode, CommandNotFound
from gitlint.tests.base import BaseTestCase
from gitlint.git import GitContext, GitContextError, GitNotInstalledError, git_commentchar, git_hooks_dir
class GitTests(BaseTestCase):
expected_sh_special_args = {
... | "ä") | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/git/test_git.py | test_git_commentchar | self.assertEqual | string_literal | 28 | import os
from unittest.mock import patch
from gitlint.shell import ErrorReturnCode, CommandNotFound
from gitlint.tests.base import BaseTestCase
from gitlint.git import GitContext, GitContextError, GitNotInstalledError, git_commentchar, git_hooks_dir
class GitTests(BaseTestCase):
expected_sh_special_args = {
... | ';') | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/git/test_git.py | test_git_no_commits_error | assert_* | string_literal | 49 | import os
from unittest.mock import patch
from gitlint.shell import ErrorReturnCode, CommandNotFound
from gitlint.tests.base import BaseTestCase
from gitlint.git import GitContext, GitContextError, GitNotInstalledError, git_commentchar, git_hooks_dir
class GitTests(BaseTestCase):
expected_sh_special_args = {
... | "HEAD") | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/git/test_git.py | test_git_hooks_dir | assert_* | string_literal | 24 | import os
from unittest.mock import patch
from gitlint.shell import ErrorReturnCode, CommandNotFound
from gitlint.tests.base import BaseTestCase
from gitlint.git import GitContext, GitContextError, GitNotInstalledError, git_commentchar, git_hooks_dir
class GitTests(BaseTestCase):
expected_sh_special_args = {
... | "hooks") | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/git/test_git.py | test_get_latest_commit_command_not_found | assert_* | string_literal | 27 | import os
from unittest.mock import patch
from gitlint.shell import ErrorReturnCode, CommandNotFound
from gitlint.tests.base import BaseTestCase
from gitlint.git import GitContext, GitContextError, GitNotInstalledError, git_commentchar, git_hooks_dir
class GitTests(BaseTestCase):
expected_sh_special_args = {
... | "--pretty=%H") | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/git/test_git.py | test_git_commentchar | assert_* | string_literal | 30 | import os
from unittest.mock import patch
from gitlint.shell import ErrorReturnCode, CommandNotFound
from gitlint.tests.base import BaseTestCase
from gitlint.git import GitContext, GitContextError, GitNotInstalledError, git_commentchar, git_hooks_dir
class GitTests(BaseTestCase):
expected_sh_special_args = {
... | "core.commentchar") | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/git/test_git.py | test_git_hooks_dir | self.assertEqual | func_call | 22 | import os
from unittest.mock import patch
from gitlint.shell import ErrorReturnCode, CommandNotFound
from gitlint.tests.base import BaseTestCase
from gitlint.git import GitContext, GitContextError, GitNotInstalledError, git_commentchar, git_hooks_dir
class GitTests(BaseTestCase):
expected_sh_special_args = {
... | os.path.abspath(os.path.join("/blä", hooks_dir))) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/git/test_git_commit.py | test_from_commit_msg_full | self.assertEqual | numeric_literal | 63 | import copy
import datetime
import dateutil
import arrow
from unittest.mock import patch, call
from gitlint.tests.base import BaseTestCase
from gitlint.git import GitContext, GitCommit, GitContextError, LocalGitCommit, StagedLocalGitCommit, GitCommitMessage
from gitlint.shell import ErrorReturnCode
class GitCommit... | 1) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/git/test_git_commit.py | test_get_latest_commit_merge_commit | self.assertEqual | collection | 53 | import copy
import datetime
import dateutil
import arrow
from unittest.mock import patch, call
from gitlint.tests.base import BaseTestCase
from gitlint.git import GitContext, GitCommit, GitContextError, LocalGitCommit, StagedLocalGitCommit, GitCommitMessage
from gitlint.shell import ErrorReturnCode
class GitCommit... | []) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/git/test_git_commit.py | test_from_commit_msg_empty | self.assertEqual | string_literal | 28 | import copy
import datetime
import dateutil
import arrow
from unittest.mock import patch, call
from gitlint.tests.base import BaseTestCase
from gitlint.git import GitContext, GitCommit, GitContextError, LocalGitCommit, StagedLocalGitCommit, GitCommitMessage
from gitlint.shell import ErrorReturnCode
class GitCommit... | "") | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/git/test_git_context.py | test_gitcontext | self.assertEqual | collection | 28 | from unittest.mock import patch, call
from gitlint.tests.base import BaseTestCase
from gitlint.git import GitContext
class GitContextTests(BaseTestCase):
expected_sh_special_args = {
'_tty_out': False,
'_cwd': "fåke/path"
}
@patch('gitlint.git.sh')
def test_gitcontext(self, sh):
... | []) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/git/test_git_context.py | test_gitcontext | self.assertEqual | string_literal | 31 | from unittest.mock import patch, call
from gitlint.tests.base import BaseTestCase
from gitlint.git import GitContext
class GitContextTests(BaseTestCase):
expected_sh_special_args = {
'_tty_out': False,
'_cwd': "fåke/path"
}
@patch('gitlint.git.sh')
def test_gitcontext(self, sh):
... | "#") | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/git/test_git_context.py | test_gitcontext | self.assertEqual | string_literal | 35 | from unittest.mock import patch, call
from gitlint.tests.base import BaseTestCase
from gitlint.git import GitContext
class GitContextTests(BaseTestCase):
expected_sh_special_args = {
'_tty_out': False,
'_cwd': "fåke/path"
}
@patch('gitlint.git.sh')
def test_gitcontext(self, sh):
... | "foöbar") | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/git/test_git_context.py | test_gitcontext_equality | self.assertEqual | variable | 29 | from unittest.mock import patch, call
from gitlint.tests.base import BaseTestCase
from gitlint.git import GitContext
class GitContextTests(BaseTestCase):
expected_sh_special_args = {
'_tty_out': False,
'_cwd': "fåke/path"
}
@patch('gitlint.git.sh')
def test_gitcontext_equality(self, ... | context2) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/git/test_git_context.py | test_gitcontext_equality | self.assertNotEqual | variable | 48 | from unittest.mock import patch, call
from gitlint.tests.base import BaseTestCase
from gitlint.git import GitContext
class GitContextTests(BaseTestCase):
expected_sh_special_args = {
'_tty_out': False,
'_cwd': "fåke/path"
}
@patch('gitlint.git.sh')
def test_gitcontext_equality(self, ... | context3) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/git/test_git_context.py | test_gitcontext_equality | self.assertNotEqual | variable | 57 | from unittest.mock import patch, call
from gitlint.tests.base import BaseTestCase
from gitlint.git import GitContext
class GitContextTests(BaseTestCase):
expected_sh_special_args = {
'_tty_out': False,
'_cwd': "fåke/path"
}
@patch('gitlint.git.sh')
def test_gitcontext_equality(self, ... | context4) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/git/test_git_context.py | test_gitcontext | self.assertEqual | variable | 36 | from unittest.mock import patch, call
from gitlint.tests.base import BaseTestCase
from gitlint.git import GitContext
class GitContextTests(BaseTestCase):
expected_sh_special_args = {
'_tty_out': False,
'_cwd': "fåke/path"
}
@patch('gitlint.git.sh')
def test_gitcontext(self, sh):
... | expected_calls) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/git/test_git_context.py | test_gitcontext | self.assertEqual | complex_expr | 32 | from unittest.mock import patch, call
from gitlint.tests.base import BaseTestCase
from gitlint.git import GitContext
class GitContextTests(BaseTestCase):
expected_sh_special_args = {
'_tty_out': False,
'_cwd': "fåke/path"
}
@patch('gitlint.git.sh')
def test_gitcontext(self, sh):
... | expected_calls[0:1]) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/rules/test_body_rules.py | test_max_line_length | self.assertIsNone | variable | 11 | from gitlint.tests.base import BaseTestCase
from gitlint import rules
class BodyRuleTests(BaseTestCase):
def test_max_line_length(self):
rule = rules.BodyMaxLineLength()
# assert no error
violation = rule.validate("å" * 80, None)
self.assertIsNone( | violation) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/rules/test_body_rules.py | test_max_line_length | self.assertIsNone | variable | 21 | from gitlint.tests.base import BaseTestCase
from gitlint import rules
class BodyRuleTests(BaseTestCase):
def test_max_line_length(self):
rule = rules.BodyMaxLineLength()
# assert no error
violation = rule.validate("å" * 80, None)
self.assertIsNone(violation)
# assert error... | violations) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/rules/test_configuration_rules.py | test_ignore_by_title | assert_* | collection | 15 | from gitlint.tests.base import BaseTestCase
from gitlint import rules
from gitlint.config import LintConfig
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't be cha... | []) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/rules/test_configuration_rules.py | test_ignore_body_lines | self.assertEqual | variable | 17 | from gitlint.tests.base import BaseTestCase
from gitlint import rules
from gitlint.config import LintConfig
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\nThis is\... | commit2) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/rules/test_configuration_rules.py | test_ignore_by_title | self.assertEqual | func_call | 14 | from gitlint.tests.base import BaseTestCase
from gitlint import rules
from gitlint.config import LintConfig
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't be cha... | LintConfig()) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/rules/test_configuration_rules.py | test_ignore_by_title | self.assertEqual | variable | 22 | from gitlint.tests.base import BaseTestCase
from gitlint import rules
from gitlint.config import LintConfig
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't be cha... | expected_config) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/rules/test_configuration_rules.py | test_ignore_by_title | assert_* | variable | 26 | from gitlint.tests.base import BaseTestCase
from gitlint import rules
from gitlint.config import LintConfig
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't be cha... | expected_log_message) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/rules/test_meta_rules.py | test_author_valid_email_rule | self.assertIsNone | variable | 21 | from gitlint.tests.base import BaseTestCase
from gitlint.rules import AuthorValidEmail, RuleViolation
class MetaRuleTests(BaseTestCase):
def test_author_valid_email_rule(self):
rule = AuthorValidEmail()
# valid email addresses
valid_email_addresses = ["föo@bar.com", "Jöhn.Doe@bar.com", "jö... | violations) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/rules/test_meta_rules.py | test_author_valid_email_rule | self.assertListEqual | collection | 30 | from gitlint.tests.base import BaseTestCase
from gitlint.rules import AuthorValidEmail, RuleViolation
class MetaRuleTests(BaseTestCase):
def test_author_valid_email_rule(self):
rule = AuthorValidEmail()
# valid email addresses
valid_email_addresses = ["föo@bar.com", "Jöhn.Doe@bar.com", "jö... | [RuleViolation("M1", "Author email for commit is invalid", email)]) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/rules/test_rules.py | test_rule_equality | self.assertNotEqual | variable | 13 | from gitlint.tests.base import BaseTestCase
from gitlint.rules import Rule, RuleViolation
class RuleTests(BaseTestCase):
def test_rule_equality(self):
self.assertEqual(Rule(), Rule())
# Ensure rules are not equal if they differ on their attributes
for attr in ["id", "name", "target", "opti... | rule) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/rules/test_rules.py | test_rule_equality | self.assertEqual | func_call | 8 | from gitlint.tests.base import BaseTestCase
from gitlint.rules import Rule, RuleViolation
class RuleTests(BaseTestCase):
def test_rule_equality(self):
self.assertEqual(Rule(), | Rule()) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/rules/test_rules.py | test_rule_log | assert_* | string_literal | 10 | from gitlint.tests.base import BaseTestCase
from gitlint.rules import Rule, RuleViolation
class RuleTests(BaseTestCase):
def test_rule_log(self):
rule = Rule()
rule.log.debug("Tēst message")
self.assert_log_contains( | "DEBUG: gitlint.rules Tēst message") | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/rules/test_title_rules.py | test_max_line_length | self.assertIsNone | variable | 12 | from gitlint.tests.base import BaseTestCase
from gitlint.rules import TitleMaxLength, TitleTrailingWhitespace, TitleHardTab, TitleMustNotContainWord, \
TitleTrailingPunctuation, TitleLeadingWhitespace, TitleRegexMatches, RuleViolation, TitleMinLength
class TitleRuleTests(BaseTestCase):
def test_max_line_length... | violation) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/rules/test_title_rules.py | test_max_line_length | self.assertIsNone | variable | 22 | from gitlint.tests.base import BaseTestCase
from gitlint.rules import TitleMaxLength, TitleTrailingWhitespace, TitleHardTab, TitleMustNotContainWord, \
TitleTrailingPunctuation, TitleLeadingWhitespace, TitleRegexMatches, RuleViolation, TitleMinLength
class TitleRuleTests(BaseTestCase):
def test_max_line_length... | violations) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/rules/test_title_rules.py | test_max_line_length | self.assertListEqual | collection | 17 | from gitlint.tests.base import BaseTestCase
from gitlint.rules import TitleMaxLength, TitleTrailingWhitespace, TitleHardTab, TitleMustNotContainWord, \
TitleTrailingPunctuation, TitleLeadingWhitespace, TitleRegexMatches, RuleViolation, TitleMinLength
class TitleRuleTests(BaseTestCase):
def test_max_line_length... | [expected_violation]) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/rules/test_user_rules.py | test_empty_user_classes | self.assertListEqual | collection | 17 | import os
import sys
from gitlint.tests.base import BaseTestCase
from gitlint.rule_finder import find_rule_classes, assert_valid_rule_class
from gitlint.rules import UserRuleError
from gitlint import options, rules
class UserRuleTests(BaseTestCase):
def test_empty_user_classes(self):
# Test that we don'... | []) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/rules/test_user_rules.py | test_find_rule_classes | self.assertEqual | string_literal | 32 | import os
import sys
from gitlint.tests.base import BaseTestCase
from gitlint.rule_finder import find_rule_classes, assert_valid_rule_class
from gitlint.rules import UserRuleError
from gitlint import options, rules
class UserRuleTests(BaseTestCase):
def test_find_rule_classes(self):
# Let's find some use... | "UC1") | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/rules/test_user_rules.py | test_find_rule_classes | self.assertIn | complex_expr | 28 | import os
import sys
from gitlint.tests.base import BaseTestCase
from gitlint.rule_finder import find_rule_classes, assert_valid_rule_class
from gitlint.rules import UserRuleError
from gitlint import options, rules
class UserRuleTests(BaseTestCase):
def test_find_rule_classes(self):
# Let's find some use... | sys.path) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/rules/test_user_rules.py | test_rules_from_init_file | self.assertListEqual | variable | 23 | import os
import sys
from gitlint.tests.base import BaseTestCase
from gitlint.rule_finder import find_rule_classes, assert_valid_rule_class
from gitlint.rules import UserRuleError
from gitlint import options, rules
class UserRuleTests(BaseTestCase):
def test_rules_from_init_file(self):
# Test that we ca... | expected) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/rules/test_user_rules.py | test_find_rule_classes | self.assertIn | complex_expr | 29 | import os
import sys
from gitlint.tests.base import BaseTestCase
from gitlint.rule_finder import find_rule_classes, assert_valid_rule_class
from gitlint.rules import UserRuleError
from gitlint import options, rules
class UserRuleTests(BaseTestCase):
def test_find_rule_classes(self):
# Let's find some use... | sys.modules) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/rules/test_user_rules.py | test_assert_valid_rule_class_negative_target | assert_* | variable | 25 | import os
import sys
from gitlint.tests.base import BaseTestCase
from gitlint.rule_finder import find_rule_classes, assert_valid_rule_class
from gitlint.rules import UserRuleError
from gitlint import options, rules
class UserRuleTests(BaseTestCase):
def test_assert_valid_rule_class_negative_target(self):
... | MyRuleClass) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_cache.py | test_cache | self.assertEqual | numeric_literal | 10 | from gitlint.tests.base import BaseTestCase
from gitlint.cache import PropertyCache, cache
class CacheTests(BaseTestCase):
def test_cache(self):
# Init new class with cached properties
myclass = self.MyClass()
self.assertEqual(myclass.counter, | 0) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_cache.py | test_cache | self.assertEqual | numeric_literal | 15 | from gitlint.tests.base import BaseTestCase
from gitlint.cache import PropertyCache, cache
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) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_cache.py | test_cache | self.assertDictEqual | collection | 11 | from gitlint.tests.base import BaseTestCase
from gitlint.cache import PropertyCache, cache
class CacheTests(BaseTestCase):
def test_cache(self):
# Init new class with cached properties
myclass = self.MyClass()
self.assertEqual(myclass.counter, 0)
self.assertDictEqual(myclass._cach... | {}) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_cache.py | test_cache | self.assertEqual | string_literal | 14 | from gitlint.tests.base import BaseTestCase
from gitlint.cache import PropertyCache, cache
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... | "bår") | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_cache.py | test_cache_custom_key | self.assertEqual | string_literal | 14 | from gitlint.tests.base import BaseTestCase
from gitlint.cache import PropertyCache, cache
class CacheTests(BaseTestCase):
def test_cache_custom_key(self):
# Init new class with cached properties
myclass = self.MyClass()
self.assertEqual(myclass.counter, 0)
self.assertDictEqual(myc... | "fōo") | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_display.py | test_v | self.assertEqual | func_call | 35 | from io import StringIO
from unittest.mock import patch # pylint: disable=no-name-in-module, import-error
from gitlint.display import Display
from gitlint.config import LintConfig
from gitlint.tests.base import BaseTestCase
class DisplayTests(BaseTestCase):
def test_v(self):
display = Display(LintConfig... | stderr.getvalue()) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_display.py | test_v | self.assertEqual | func_call | 23 | from io import StringIO
from unittest.mock import patch # pylint: disable=no-name-in-module, import-error
from gitlint.display import Display
from gitlint.config import LintConfig
from gitlint.tests.base import BaseTestCase
class DisplayTests(BaseTestCase):
def test_v(self):
display = Display(LintConfig... | stdout.getvalue()) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_hooks.py | test_install_commit_msg_hook | assert_* | variable | 30 | import os
from unittest.mock import patch, ANY, mock_open
from gitlint.tests.base import BaseTestCase
from gitlint.config import LintConfig
from gitlint.hooks import GitHookInstaller, GitHookInstallerError, COMMIT_MSG_HOOK_SRC_PATH, COMMIT_MSG_HOOK_DST_PATH, \
GITLINT_HOOK_IDENTIFIER
class HookTests(BaseTestCase... | ANY) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_hooks.py | test_install_commit_msg_hook | assert_* | variable | 27 | import os
from unittest.mock import patch, ANY, mock_open
from gitlint.tests.base import BaseTestCase
from gitlint.config import LintConfig
from gitlint.hooks import GitHookInstaller, GitHookInstallerError, COMMIT_MSG_HOOK_SRC_PATH, COMMIT_MSG_HOOK_DST_PATH, \
GITLINT_HOOK_IDENTIFIER
class HookTests(BaseTestCase... | expected_dst) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_hooks.py | test_commit_msg_hook_path | self.assertEqual | variable | 22 | import os
from unittest.mock import patch, ANY, mock_open
from gitlint.tests.base import BaseTestCase
from gitlint.config import LintConfig
from gitlint.hooks import GitHookInstaller, GitHookInstallerError, COMMIT_MSG_HOOK_SRC_PATH, COMMIT_MSG_HOOK_DST_PATH, \
GITLINT_HOOK_IDENTIFIER
class HookTests(BaseTestCase... | expected_path) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_hooks.py | test_commit_msg_hook_path | assert_* | complex_expr | 21 | import os
from unittest.mock import patch, ANY, mock_open
from gitlint.tests.base import BaseTestCase
from gitlint.config import LintConfig
from gitlint.hooks import GitHookInstaller, GitHookInstallerError, COMMIT_MSG_HOOK_SRC_PATH, COMMIT_MSG_HOOK_DST_PATH, \
GITLINT_HOOK_IDENTIFIER
class HookTests(BaseTestCase... | self.SAMPLES_DIR) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_hooks.py | test_install_commit_msg_hook | assert_* | complex_expr | 31 | import os
from unittest.mock import patch, ANY, mock_open
from gitlint.tests.base import BaseTestCase
from gitlint.config import LintConfig
from gitlint.hooks import GitHookInstaller, GitHookInstallerError, COMMIT_MSG_HOOK_SRC_PATH, COMMIT_MSG_HOOK_DST_PATH, \
GITLINT_HOOK_IDENTIFIER
class HookTests(BaseTestCase... | lint_config.target) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_hooks.py | test_uninstall_commit_msg_hook | assert_* | complex_expr | 27 | import os
from unittest.mock import patch, ANY, mock_open
from gitlint.tests.base import BaseTestCase
from gitlint.config import LintConfig
from gitlint.hooks import GitHookInstaller, GitHookInstallerError, COMMIT_MSG_HOOK_SRC_PATH, COMMIT_MSG_HOOK_DST_PATH, \
GITLINT_HOOK_IDENTIFIER
class HookTests(BaseTestCase... | git_hooks_dir.return_value) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_lint.py | test_lint_configuration_rule | self.assertListEqual | collection | 20 | from io import StringIO
from unittest.mock import patch # pylint: disable=no-name-in-module, import-error
from gitlint.tests.base import BaseTestCase
from gitlint.lint import GitLinter
from gitlint.rules import RuleViolation, TitleMustNotContainWord
from gitlint.config import LintConfig, LintConfigBuilder
class Lin... | []) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_lint.py | test_lint_sample2 | self.assertListEqual | variable | 21 | from io import StringIO
from unittest.mock import patch # pylint: disable=no-name-in-module, import-error
from gitlint.tests.base import BaseTestCase
from gitlint.lint import GitLinter
from gitlint.rules import RuleViolation, TitleMustNotContainWord
from gitlint.config import LintConfig, LintConfigBuilder
class Lin... | expected) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_lint.py | test_lint_sample1 | self.assertListEqual | variable | 30 | from io import StringIO
from unittest.mock import patch # pylint: disable=no-name-in-module, import-error
from gitlint.tests.base import BaseTestCase
from gitlint.lint import GitLinter
from gitlint.rules import RuleViolation, TitleMustNotContainWord
from gitlint.config import LintConfig, LintConfigBuilder
class Lin... | expected_errors) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_lint.py | test_print_violations | self.assertEqual | func_call | 22 | from io import StringIO
from unittest.mock import patch # pylint: disable=no-name-in-module, import-error
from gitlint.tests.base import BaseTestCase
from gitlint.lint import GitLinter
from gitlint.rules import RuleViolation, TitleMustNotContainWord
from gitlint.config import LintConfig, LintConfigBuilder
class Lin... | stderr.getvalue()) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_lint.py | test_lint_regex_rules | self.assertListEqual | variable | 36 | from io import StringIO
from unittest.mock import patch # pylint: disable=no-name-in-module, import-error
from gitlint.tests.base import BaseTestCase
from gitlint.lint import GitLinter
from gitlint.rules import RuleViolation, TitleMustNotContainWord
from gitlint.config import LintConfig, LintConfigBuilder
class Lin... | expected_violations) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_lint.py | test_ignore_named_rules | self.assertListEqual | func_call | 28 | from io import StringIO
from unittest.mock import patch # pylint: disable=no-name-in-module, import-error
from gitlint.tests.base import BaseTestCase
from gitlint.lint import GitLinter
from gitlint.rules import RuleViolation, TitleMustNotContainWord
from gitlint.config import LintConfig, LintConfigBuilder
class Lin... | linter.lint(commit)) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_options.py | test_list_option | self.assertListEqual | collection | 32 | import os
import re
from gitlint.tests.base import BaseTestCase
from gitlint.options import IntOption, BoolOption, StrOption, ListOption, PathOption, RegexOption, RuleOptionError
class RuleOptionTests(BaseTestCase):
def test_list_option(self):
# normal behavior
option = ListOption("tëst-name", "... | []) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_options.py | test_int_option | self.assertEqual | numeric_literal | 16 | import os
import re
from gitlint.tests.base import BaseTestCase
from gitlint.options import IntOption, BoolOption, StrOption, ListOption, PathOption, RegexOption, RuleOptionError
class RuleOptionTests(BaseTestCase):
def test_int_option(self):
# normal behavior
option = IntOption("tëst-name", 123... | 123) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_options.py | test_int_option | self.assertEqual | numeric_literal | 20 | import os
import re
from gitlint.tests.base import BaseTestCase
from gitlint.options import IntOption, BoolOption, StrOption, ListOption, PathOption, RegexOption, RuleOptionError
class RuleOptionTests(BaseTestCase):
def test_int_option(self):
# normal behavior
option = IntOption("tëst-name", 123... | 456) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_options.py | test_int_option | self.assertEqual | none_literal | 24 | import os
import re
from gitlint.tests.base import BaseTestCase
from gitlint.options import IntOption, BoolOption, StrOption, ListOption, PathOption, RegexOption, RuleOptionError
class RuleOptionTests(BaseTestCase):
def test_int_option(self):
# normal behavior
option = IntOption("tëst-name", 123... | None) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_options.py | test_int_option | self.assertEqual | numeric_literal | 39 | import os
import re
from gitlint.tests.base import BaseTestCase
from gitlint.options import IntOption, BoolOption, StrOption, ListOption, PathOption, RegexOption, RuleOptionError
class RuleOptionTests(BaseTestCase):
def test_int_option(self):
# normal behavior
option = IntOption("tëst-name", 123... | -456) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_options.py | test_boolean_option | self.assertEqual | bool_literal | 16 | import os
import re
from gitlint.tests.base import BaseTestCase
from gitlint.options import IntOption, BoolOption, StrOption, ListOption, PathOption, RegexOption, RuleOptionError
class RuleOptionTests(BaseTestCase):
def test_boolean_option(self):
# normal behavior
option = BoolOption("tëst-name"... | True) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_options.py | test_str_option | self.assertEqual | string_literal | 16 | import os
import re
from gitlint.tests.base import BaseTestCase
from gitlint.options import IntOption, BoolOption, StrOption, ListOption, PathOption, RegexOption, RuleOptionError
class RuleOptionTests(BaseTestCase):
def test_str_option(self):
# normal behavior
option = StrOption("tëst-name", "fö... | "föo") | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_options.py | test_str_option | self.assertEqual | string_literal | 20 | import os
import re
from gitlint.tests.base import BaseTestCase
from gitlint.options import IntOption, BoolOption, StrOption, ListOption, PathOption, RegexOption, RuleOptionError
class RuleOptionTests(BaseTestCase):
def test_str_option(self):
# normal behavior
option = StrOption("tëst-name", "fö... | "bår") | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_options.py | test_str_option | self.assertEqual | string_literal | 24 | import os
import re
from gitlint.tests.base import BaseTestCase
from gitlint.options import IntOption, BoolOption, StrOption, ListOption, PathOption, RegexOption, RuleOptionError
class RuleOptionTests(BaseTestCase):
def test_str_option(self):
# normal behavior
option = StrOption("tëst-name", "fö... | "123") | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_options.py | test_boolean_option | self.assertEqual | bool_literal | 20 | import os
import re
from gitlint.tests.base import BaseTestCase
from gitlint.options import IntOption, BoolOption, StrOption, ListOption, PathOption, RegexOption, RuleOptionError
class RuleOptionTests(BaseTestCase):
def test_boolean_option(self):
# normal behavior
option = BoolOption("tëst-name"... | False) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_options.py | test_path_option | self.assertEqual | string_literal | 16 | import os
import re
from gitlint.tests.base import BaseTestCase
from gitlint.options import IntOption, BoolOption, StrOption, ListOption, PathOption, RegexOption, RuleOptionError
class RuleOptionTests(BaseTestCase):
def test_path_option(self):
option = PathOption("tëst-directory", ".", "Tëst Description... | "dir") | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_options.py | test_str_option | self.assertEqual | string_literal | 28 | import os
import re
from gitlint.tests.base import BaseTestCase
from gitlint.options import IntOption, BoolOption, StrOption, ListOption, PathOption, RegexOption, RuleOptionError
class RuleOptionTests(BaseTestCase):
def test_str_option(self):
# normal behavior
option = StrOption("tëst-name", "fö... | "-123") | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_options.py | test_option_equality | self.assertEqual | variable | 17 | import os
import re
from gitlint.tests.base import BaseTestCase
from gitlint.options import IntOption, BoolOption, StrOption, ListOption, PathOption, RegexOption, RuleOptionError
class RuleOptionTests(BaseTestCase):
def test_option_equality(self):
options = {IntOption: 123, StrOption: "foöbar", BoolOptio... | option2) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_options.py | test_list_option | self.assertListEqual | collection | 56 | import os
import re
from gitlint.tests.base import BaseTestCase
from gitlint.options import IntOption, BoolOption, StrOption, ListOption, PathOption, RegexOption, RuleOptionError
class RuleOptionTests(BaseTestCase):
def test_list_option(self):
# normal behavior
option = ListOption("tëst-name", "... | ["123"]) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_options.py | test_int_option | self.assertEqual | string_literal | 14 | import os
import re
from gitlint.tests.base import BaseTestCase
from gitlint.options import IntOption, BoolOption, StrOption, ListOption, PathOption, RegexOption, RuleOptionError
class RuleOptionTests(BaseTestCase):
def test_int_option(self):
# normal behavior
option = IntOption("tëst-name", 123... | "tëst-name") | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_utils.py | test_use_sh_library | self.assertEqual | bool_literal | 17 | 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 in... | True) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_utils.py | test_use_sh_library | assert_* | none_literal | 18 | 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 in... | None) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_utils.py | test_use_sh_library | self.assertEqual | bool_literal | 29 | 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 in... | False) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_utils.py | test_default_encoding_non_windows | self.assertEqual | string_literal | 22 | 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 in... | "UTF-8") | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_utils.py | test_default_encoding_windows | self.assertEqual | string_literal | 27 | 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 in... | "ASCII") | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_utils.py | test_default_encoding_non_windows | self.assertEqual | string_literal | 18 | 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 in... | "foöbar") | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | gitlint/tests/test_utils.py | test_default_encoding_windows | self.assertEqual | string_literal | 29 | 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 in... | "UTF-16") | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | qa/base.py | assertEqualStdout | self.assertMultiLineEqual | variable | 47 | import io
import os
import platform
import shutil
import sys
import tempfile
from datetime import datetime
from uuid import uuid4
from unittest import TestCase
import arrow
from qa.shell import git, gitlint, RunningCommand
from qa.utils import DEFAULT_ENCODING
class BaseTestCase(TestCase):
maxDiff = None
tm... | expected) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | qa/base.py | assertEqualStdout | self.assertIsInstance | variable | 44 | import io
import os
import platform
import shutil
import sys
import tempfile
from datetime import datetime
from uuid import uuid4
from unittest import TestCase
import arrow
from qa.shell import git, gitlint, RunningCommand
from qa.utils import DEFAULT_ENCODING
class BaseTestCase(TestCase):
maxDiff = None
tm... | RunningCommand) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | qa/test_commits.py | test_violations | self.assertEqual | numeric_literal | 24 | import re
import arrow
from qa.shell import echo, git, gitlint
from qa.base import BaseTestCase
class CommitsTests(BaseTestCase):
def test_violations(self):
""" Test linting multiple commits with violations """
git("checkout", "-b", "test-branch-commits-violations-base", _cwd=self.tmp_git_repo)
... | 4) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | qa/test_commits.py | test_lint_empty_commit_range | self.assertEqual | numeric_literal | 21 | import re
import arrow
from qa.shell import echo, git, gitlint
from qa.base import BaseTestCase
class CommitsTests(BaseTestCase):
def test_lint_empty_commit_range(self):
""" Tests `gitlint --commits <sha>^...<sha>` --fail-without-commits where the provided range is empty. """
self.create_simple_... | 0) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | qa/test_commits.py | test_lint_single_commit | self.assertEqual | numeric_literal | 21 | import re
import arrow
from qa.shell import echo, git, gitlint
from qa.base import BaseTestCase
class CommitsTests(BaseTestCase):
def test_lint_single_commit(self):
""" Tests `gitlint --commits <sha>^...<same sha>` """
self.create_simple_commit("Sïmple title.\n")
self.create_simple_commi... | 2) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | qa/test_commits.py | test_lint_staged_stdin | self.assertEqual | numeric_literal | 43 | import re
import arrow
from qa.shell import echo, git, gitlint
from qa.base import BaseTestCase
class CommitsTests(BaseTestCase):
def test_lint_staged_stdin(self):
""" Tests linting a staged commit. Gitint should lint the passed commit message andfetch additional meta-data
from the underlyin... | 3) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | qa/test_commits.py | test_lint_empty_commit_range | self.assertEqual | complex_expr | 27 | import re
import arrow
from qa.shell import echo, git, gitlint
from qa.base import BaseTestCase
class CommitsTests(BaseTestCase):
def test_lint_empty_commit_range(self):
""" Tests `gitlint --commits <sha>^...<sha>` --fail-without-commits where the provided range is empty. """
self.create_simple_... | self.GITLINT_USAGE_ERROR) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
jorisroovers/gitlint | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | train | train | qa/test_gitlint.py | test_successful_merge_commit | self.assertEqual | numeric_literal | 33 | import io
import os
from qa.shell import echo, git, gitlint
from qa.base import BaseTestCase
from qa.utils import DEFAULT_ENCODING
class IntegrationTests(BaseTestCase):
def test_successful_merge_commit(self):
# Create branch on master
self.create_simple_commit("Cömmit on master\n\nSimple bödy")
... | 1) | c5fcff0692eb84b7b43cace42e4b0eea799f52c6 | 171 | v2_extractor_at_anchor |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.