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 |
|---|---|---|---|---|---|---|---|---|---|
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... | 3) | self.assertEqual | numeric_literal | gitlint-core/gitlint/tests/config/test_config_precedence.py | test_general_option_after_rule_option | LintConfigPrecedenceTests | 98 | 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",
... | violations) | self.assertIsNone | variable | gitlint-core/gitlint/tests/rules/test_meta_rules.py | test_author_valid_email_rule | MetaRuleTests | 28 | null |
jorisroovers/gitlint | import re
import arrow
from qa.base import BaseTestCase
from qa.shell import echo, git, gitlint
class CommitsTests(BaseTestCase):
def test_csv_hash_list(self):
"""Test linting multiple commits (comma-separated) with violations"""
git("checkout", "-b", "test-branch-commits-violations-base", _cwd=... | 6) | self.assertEqual | numeric_literal | qa/test_commits.py | test_csv_hash_list | CommitsTests | 68 | 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: T1 Title exceeds max length (14>5): "This is å test"\n') | self.assertEqual | string_literal | gitlint-core/gitlint/tests/config/test_config_precedence.py | test_ignore_precedence | LintConfigPrecedenceTests | 84 | null |
jorisroovers/gitlint | from io import StringIO
from unittest.mock import patch
from gitlint.config import LintConfig
from gitlint.display import Display
from gitlint.tests.base import BaseTestCase
class DisplayTests(BaseTestCase):
def test_v(self):
display = Display(LintConfig())
display.config.verbosity = 2
wi... | stderr.getvalue()) | self.assertEqual | func_call | gitlint-core/gitlint/tests/test_display.py | test_v | DisplayTests | 34 | 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__))
... | clazz.id.startswith("CB")) | self.assertTrue | func_call | gitlint-core/gitlint/tests/contrib/test_contrib_rules.py | test_contrib_rule_naming_conventions | ContribRuleTests | 47 | null |
jorisroovers/gitlint | from gitlint.cache import PropertyCache, cache
from gitlint.tests.base import BaseTestCase
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") | self.assertEqual | string_literal | gitlint-core/gitlint/tests/test_cache.py | test_cache_custom_key | CacheTests | 48 | 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... | expected_calls) | self.assertEqual | variable | gitlint-core/gitlint/tests/git/test_git.py | test_git_no_commits_get_branch | GitTests | 99 | 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... | 6) | self.assertEqual | numeric_literal | gitlint-core/gitlint/tests/cli/test_cli.py | test_debug | CLITests | 494 | 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... | ANY) | assert_* | variable | gitlint-core/gitlint/tests/test_hooks.py | test_install_commit_msg_hook | HookTests | 44 | null |
jorisroovers/gitlint | import subprocess
from qa.base import BaseTestCase
from qa.shell import echo, gitlint
from qa.utils import FILE_ENCODING, TERMINAL_ENCODING
class StdInTests(BaseTestCase):
def test_stdin_file(self):
"""Test the scenario where STDIN is a regular file (stat.S_ISREG = True)
This is the equivalent of... | self.get_expected("test_stdin/test_stdin_file_1")) | self.assertEqual | func_call | qa/test_stdin.py | test_stdin_file | StdInTests | 53 | 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", {... | 1) | self.assertEqual | numeric_literal | gitlint-core/gitlint/tests/config/test_rule_collection.py | test_add_rule | RuleCollectionTests | 18 | 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__))
... | clazz.id.startswith("CT")) | self.assertTrue | func_call | gitlint-core/gitlint/tests/contrib/test_contrib_rules.py | test_contrib_rule_naming_conventions | ContribRuleTests | 45 | 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-16") | self.assertEqual | string_literal | gitlint-core/gitlint/tests/test_utils.py | test_terminal_encoding_windows | UtilsTests | 38 | 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... | rule) | self.assertIsNone | variable | gitlint-core/gitlint/tests/config/test_rule_collection.py | test_add_find_rule | RuleCollectionTests | 42 | 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):
# ... | [expected_violation]) | self.assertListEqual | collection | gitlint-core/gitlint/tests/contrib/rules/test_disallow_cleanup_commits.py | test_disallow_fixup_squash_commit | ContribDisallowCleanupCommitsTest | 24 | 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... | expected_calls) | self.assertEqual | variable | gitlint-core/gitlint/tests/git/test_git_context.py | test_gitcontext | GitContextTests | 29 | 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()
... | 2) | self.assertEqual | numeric_literal | gitlint-core/gitlint/tests/config/test_config_builder.py | test_set_option | LintConfigBuilderTests | 35 | 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... | self.SAMPLES_DIR) | assert_* | complex_expr | gitlint-core/gitlint/tests/test_hooks.py | test_commit_msg_hook_path | HookTests | 24 | 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... | 1) | self.assertEqual | numeric_literal | gitlint-core/gitlint/tests/cli/test_cli_hooks.py | test_run_hook_stdin_violations | CLIHookTests | 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... | "ASCII") | self.assertEqual | string_literal | gitlint-core/gitlint/tests/test_utils.py | test_terminal_encoding_windows | UtilsTests | 36 | 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_regex_rules... | expected_violations) | self.assertListEqual | variable | gitlint-core/gitlint/tests/test_lint.py | test_lint_regex_rules | LintTests | 215 | null |
jorisroovers/gitlint | import os
import platform
import shutil
import sys
import tempfile
from datetime import datetime, timezone
from unittest import TestCase
from uuid import uuid4
import arrow
from qa.shell import RunningCommand, git, gitlint
from qa.utils import FILE_ENCODING, PLATFORM_IS_WINDOWS, TERMINAL_ENCODING
class BaseTestCase(... | expected) | self.assertMultiLineEqual | variable | qa/base.py | assertEqualStdout | BaseTestCase | 45 | null |
jorisroovers/gitlint | from gitlint import rules
from gitlint.tests.base import BaseTestCase
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) | self.assertIsNone | variable | gitlint-core/gitlint/tests/rules/test_body_rules.py | test_max_line_length | BodyRuleTests | 21 | 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,
... | []) | assert_* | collection | gitlint-core/gitlint/tests/test_deprecation.py | test_get_regex_method | DeprecationTests | 38 | 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__))
... | clazz.name.startswith("contrib-")) | self.assertTrue | func_call | gitlint-core/gitlint/tests/contrib/test_contrib_rules.py | test_contrib_rule_naming_conventions | ContribRuleTests | 40 | 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... | clone) | self.assertEqual | variable | gitlint-core/gitlint/tests/base.py | object_equality_test | BaseTestCase | 207 | 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... | "dûr") | self.assertEqual | string_literal | gitlint-core/gitlint/tests/config/test_rule_collection.py | test_delete_rules_by_attr | RuleCollectionTests | 62 | 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... | contrib_rules) | self.assertEqual | variable | gitlint-core/gitlint/tests/config/test_config.py | test_contrib | LintConfigTests | 127 | 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,
... | [EXPECTED_REGEX_STYLE_SEARCH_DEPRECATION_WARNING.format(rule.id, rule.name)]) | assert_* | collection | gitlint-core/gitlint/tests/test_deprecation.py | test_get_regex_method | DeprecationTests | 44 | 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_empty_commit_range(self):
"""Tests `gitlint --commits <sha>^...<sha>` --fail-without-commits where the provided range is empty."""
self.create_simple_co... | 0) | self.assertEqual | numeric_literal | qa/test_commits.py | test_lint_empty_commit_range | CommitsTests | 82 | 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_extra_path(self):
... | "UC1") | self.assertEqual | string_literal | gitlint-core/gitlint/tests/config/test_config.py | test_extra_path | LintConfigTests | 185 | 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... | context3) | self.assertNotEqual | variable | gitlint-core/gitlint/tests/git/test_git_context.py | test_gitcontext_equality | GitContextTests | 64 | 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 | string_literal | gitlint-core/gitlint/tests/git/test_git_commit.py | test_from_commit_msg_empty | GitCommitTests | 525 | 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... | "--pretty=%H") | assert_* | string_literal | gitlint-core/gitlint/tests/git/test_git.py | test_get_latest_commit_command_not_found | GitTests | 30 | 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... | 2) | self.assertEqual | numeric_literal | qa/test_commits.py | test_lint_single_commit | CommitsTests | 110 | 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_sample2(sel... | expected) | self.assertListEqual | variable | gitlint-core/gitlint/tests/test_lint.py | test_lint_sample2 | LintTests | 43 | 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... | git_hooks_dir.return_value) | assert_* | complex_expr | gitlint-core/gitlint/tests/test_hooks.py | test_install_commit_msg_hook_negative | HookTests | 61 | 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 | 94 | 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.assertEqual | numeric_literal | gitlint-core/gitlint/tests/test_cache.py | test_cache | CacheTests | 28 | 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_empty_commit_range(self):
"""Tests `gitlint --commits <sha>^...<sha>` --fail-without-commits where the provided range is empty."""
self.create_simple_co... | self.GITLINT_USAGE_ERROR) | self.assertEqual | complex_expr | qa/test_commits.py | test_lint_empty_commit_range | CommitsTests | 94 | 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... | violations) | self.assertListEqual | variable | gitlint-core/gitlint/tests/contrib/rules/test_authors_commit.py | test_authors_invalid_combination_fails | ContribAuthorsCommitTests | 87 | 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... | expected_config) | self.assertEqual | variable | gitlint-core/gitlint/tests/rules/test_configuration_rules.py | test_ignore_by_title | ConfigurationRuleTests | 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... | expected) | self.assertListEqual | variable | gitlint-core/gitlint/tests/base.py | assert_logged | BaseTestCase | 150 | 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)
rule.log.debug("Tēst message")
self.assert_log_contains( | "DEBUG: gitlint.rules Tēst message") | assert_* | string_literal | gitlint-core/gitlint/tests/rules/test_rules.py | test_rule_log | RuleTests | 27 | 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__))
... | len(class_ids)) | self.assertEqual | func_call | gitlint-core/gitlint/tests/contrib/test_contrib_rules.py | test_contrib_rule_uniqueness | ContribRuleTests | 61 | null |
jorisroovers/gitlint | import re
import arrow
from qa.base import BaseTestCase
from qa.shell import echo, git, gitlint
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) | self.assertEqual | numeric_literal | qa/test_commits.py | test_violations | CommitsTests | 42 | 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_configurati... | []) | self.assertListEqual | collection | gitlint-core/gitlint/tests/test_lint.py | test_lint_configuration_rule | LintTests | 135 | 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_clone(self):
config_builder = LintConfigBuilder()
config_builder.set_option("general", "... | expected) | self.assertDictEqual | variable | gitlint-core/gitlint/tests/config/test_config_builder.py | test_clone | LintConfigBuilderTests | 206 | 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... | "CC1") | self.assertEqual | string_literal | gitlint-core/gitlint/tests/config/test_config.py | test_contrib | LintConfigTests | 152 | null |
jorisroovers/gitlint | import os
import platform
import shutil
import sys
import tempfile
from datetime import datetime, timezone
from unittest import TestCase
from uuid import uuid4
import arrow
from qa.shell import RunningCommand, git, gitlint
from qa.utils import FILE_ENCODING, PLATFORM_IS_WINDOWS, TERMINAL_ENCODING
class BaseTestCase(... | RunningCommand) | self.assertIsInstance | variable | qa/base.py | assertEqualStdout | BaseTestCase | 42 | 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... | expected) | self.assertEqual | variable | gitlint-core/gitlint/tests/config/test_rule_collection.py | test_add_find_rule | RuleCollectionTests | 31 | 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... | obj.__class__(**attr_kwargs_copy)) | self.assertNotEqual | func_call | gitlint-core/gitlint/tests/base.py | object_equality_test | BaseTestCase | 214 | 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_enable(self):
# Test that rule can be e... | config.rules) | self.assertIn | complex_expr | gitlint-core/gitlint/tests/contrib/rules/test_disallow_cleanup_commits.py | test_enable | ContribDisallowCleanupCommitsTest | 13 | 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... | "hooks") | assert_* | string_literal | gitlint-core/gitlint/tests/git/test_git.py | test_git_hooks_dir | GitTests | 121 | 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... | "") | self.assertEqual | string_literal | gitlint-core/gitlint/tests/cli/test_cli_hooks.py | test_run_hook_stdin_no_violations | CLIHookTests | 238 | 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... | "bår") | self.assertEqual | string_literal | gitlint-core/gitlint/tests/test_options.py | test_str_option | RuleOptionTests | 86 | 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 | collection | gitlint-core/gitlint/tests/git/test_git_context.py | test_gitcontext | GitContextTests | 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_option(self):
config_builder = LintConfigBuilder()
config = config_builder.build()
... | 3) | self.assertEqual | numeric_literal | gitlint-core/gitlint/tests/config/test_config_builder.py | test_set_option | LintConfigBuilderTests | 17 | 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... | context4) | self.assertNotEqual | variable | gitlint-core/gitlint/tests/git/test_git_context.py | test_gitcontext_equality | GitContextTests | 73 | null |
richardkiss/pycoin | import unittest
from pycoin.symbols.btc import network
class ParseTest(unittest.TestCase):
def test_parse_electrum_pub(self):
E_PUB = (
"E:"
"79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"
"483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10... | "1EHNa6Q4Jz2uvNExL497mE43ikXhwF6kZm") | self.assertEqual | string_literal | tests/parse_test.py | test_parse_electrum_pub | ParseTest | 54 | null |
richardkiss/pycoin | import unittest
from pycoin.symbols.btc import network as BTC
from pycoin.symbols.xtn import network as XTN
class KeyParserTest(unittest.TestCase):
def test_parse_bip32_prv(self):
key = BTC.parse("xprv9s21ZrQH143K31AgNK5pyVvW23gHnkBq2wh5aEk6g1s496M8ZMjx"
"ncCKZKgb5jZoY5eSJMJ2Vbyvi... | "1NV3j6NgeAkWBytXiQkWxMFLBtTdbef1rp") | self.assertEqual | string_literal | tests/keyparser_test.py | test_parse_bip32_prv | KeyParserTest | 17 | null |
richardkiss/pycoin | import io
import unittest
from pycoin.encoding.hexbytes import h2b
from pycoin.symbols.btc import network
Block = network.block
Tx = network.tx
flags = network.validator.flags
block_80971_cs = h2b('00000000001126456C67A1F5F0FF0268F53B4F22E0531DC70C7B69746AF69DAC')
block_80971_data = h2b(
"01000000950A1631FB9FAC4... | '1DmapcnrJNGeJB13fv9ngRFX1iRvR4zamn') | self.assertEqual | string_literal | tests/build_tx_test.py | test_tx_out_address | BuildTxTest | 112 | null |
richardkiss/pycoin | import unittest
from pycoin.encoding.hexbytes import h2b
from pycoin.symbols.btc import network as BTC
from pycoin.symbols.xtn import network as XTN
class Bip0032TestCase(unittest.TestCase):
def test_vector_1(self):
master = BTC.keys.bip32_seed(h2b("000102030405060708090a0b0c0d0e0f"))
self.assert... | pub_mp0.hwif()) | self.assertEqual | func_call | tests/btc/bip32_test.py | test_vector_1 | Bip0032TestCase | 37 | null |
richardkiss/pycoin | import unittest
from pycoin.encoding.hexbytes import h2b
from pycoin.symbols.btc import network as BTC
from pycoin.symbols.xtn import network as XTN
class Bip0032TestCase(unittest.TestCase):
def test_streams(self):
m0 = BTC.keys.bip32_seed(b"foo bar baz")
pm0 = m0.public_copy()
self.asser... | k3.hwif()) | self.assertEqual | func_call | tests/btc/bip32_test.py | test_streams | Bip0032TestCase | 217 | null |
richardkiss/pycoin | import unittest
from pycoin.ecdsa.secp256k1 import secp256k1_generator
from pycoin.ecdsa.intstream import to_bytes, from_bytes
class ECDSATestCase(unittest.TestCase):
def test_infinity(self):
infinity = secp256k1_generator.infinity()
self.assertEqual(secp256k1_generator * 0, infinity)
sel... | g2) | self.assertEqual | variable | tests/ecdsa/ecdsa_test.py | test_infinity | ECDSATestCase | 19 | null |
richardkiss/pycoin | import unittest
from pycoin.coins.bitcoin.SolutionChecker import TxContext
from pycoin.coins.bitcoin.VM import BitcoinVM
from pycoin.encoding.hexbytes import h2b
from pycoin.intbytes import int2byte
from pycoin.satoshi.opcodes import OPCODE_LIST
from pycoin.satoshi.IntStreamer import IntStreamer
from pycoin.symbols.bt... | b'' | assert | string_literal | tests/tools_test.py | test_pr_364 | ToolsTest | 114 | null |
richardkiss/pycoin | import textwrap
import unittest
from pycoin.symbols.btc import network as BTC
from pycoin.symbols.xtn import network as XTN
def test_msg_parse():
"""
Test against real-world signatures found in the wild.
"""
# Output from brainwallet in "multibit" mode.
multibit = '''
-----BEGIN BITCOIN SIGN... | '15etuU8kwLFCBbCNRsgQTvWgrGWY9829ej' | assert | string_literal | tests/msg_signing_test.py | test_msg_parse | 95 | null | |
richardkiss/pycoin | import io
import pytest
import unittest
from pycoin.encoding.hexbytes import h2b
from pycoin.symbols.grs import network as GroestlcoinMainnet
pytest.importorskip('groestlcoin_hash')
BLOCK_HASH = '00000000000434d5b8d1c3308df7b6e3fd773657dfb28f5dd2f70854ef94cc66'
class GroestlcoinBlockTestCase(unittest.TestCase):
... | 'Fdi7YYeN7nmnjJPqQDGy8vudgQ26FVjNrk') | self.assertEqual | string_literal | tests/grs/grs_block_test.py | test_block_txs | GroestlcoinBlockTestCase | 59 | null |
richardkiss/pycoin | import binascii
import unittest
from pycoin.encoding.hexbytes import h2b
from pycoin.symbols.btc import network
class ValidationTest(unittest.TestCase):
def setUp(self):
self._key = network.keys.private(1)
def test_validate_block_data(self):
# block 80971
block_80971_id = '0000000000... | 1) | self.assertEqual | numeric_literal | tests/validation_test.py | test_validate_block_data | ValidationTest | 118 | null |
richardkiss/pycoin | import unittest
from pycoin.symbols.btc import network
who_signed_tx = network.who_signed.who_signed_tx
Tx = network.tx
SIGHASH_ALL = network.validator.flags.SIGHASH_ALL
class WhoSignedTest(unittest.TestCase):
def multisig_M_of_N(self, M, N, unsigned_id, signed_id):
keys = [network.keys.private(secret_e... | "39qEwuwyb2cAX38MFtrNzvq3KV9hSNov3q") | self.assertEqual | string_literal | tests/who_signed_test.py | test_sign_pay_to_script_multisig | WhoSignedTest | 70 | null |
richardkiss/pycoin | import binascii
import unittest
from pycoin.satoshi import stackops
def b2h(b):
return binascii.hexlify(b).decode("utf8")
class StackOpsTest(unittest.TestCase):
def test_do_OP_SWAP(self):
s = [1, 2, 3]
stackops.do_OP_SWAP(s)
self.assertEqual(s, | [1, 3, 2]) | self.assertEqual | collection | tests/script/stackops_test.py | test_do_OP_SWAP | StackOpsTest | 79 | null |
richardkiss/pycoin | import unittest
from pycoin.ecdsa.secp256k1 import secp256k1_generator
from pycoin.ecdsa.intstream import to_bytes, from_bytes
class ECDSATestCase(unittest.TestCase):
def test_endian(self):
for e in ("big", "little"):
assert from_bytes(to_bytes(768, 2, e), e) == 768
assert from_b... | 3 | assert | numeric_literal | tests/ecdsa/ecdsa_test.py | test_endian | ECDSATestCase | 122 | null |
richardkiss/pycoin | import io
import unittest
from pycoin.encoding.hexbytes import h2b
from pycoin.symbols.btc import network
Tx = network.tx
class PayToTest(unittest.TestCase):
def test_recognize_multisig(self):
h = (
"010000000139c92b102879eb95f14e7344e4dd7d481e1238b1bfb1fa0f735068d2927b"
"2314000... | script) | self.assertEqual | variable | tests/pay_to_test.py | test_recognize_multisig | PayToTest | 36 | null |
richardkiss/pycoin | import unittest
from pycoin.symbols.btc import network as BTC
from pycoin.symbols.xtn import network as XTN
class KeyParserTest(unittest.TestCase):
def test_parse_p2wpkh_in_p2sh_priv(self):
key = BTC.parse("yprvAHcaFzWG6Xu7N2Tum3WGs6gj4sbSv6DSrWyWgNaHmm6i9aHP8uG2f"
"qUHzgHQc4S48Q5... | "3F6bDarXnXbCsVuE5CbquM6ubg16qDRbHh") | self.assertEqual | string_literal | tests/keyparser_test.py | test_parse_p2wpkh_in_p2sh_priv | KeyParserTest | 71 | null |
richardkiss/pycoin | import unittest
from pycoin.encoding.hexbytes import h2b
from pycoin.symbols.btc import network as BTC
from pycoin.symbols.xtn import network as XTN
class Bip0032TestCase(unittest.TestCase):
def test_streams(self):
m0 = BTC.keys.bip32_seed(b"foo bar baz")
pm0 = m0.public_copy()
self.asser... | pm.hwif()) | self.assertEqual | func_call | tests/btc/bip32_test.py | test_streams | Bip0032TestCase | 203 | null |
richardkiss/pycoin | import unittest
from pycoin.ecdsa.encrypt import generate_shared_public_key
from pycoin.ecdsa.secp256k1 import secp256k1_generator
class SharedPublicKeyTest(unittest.TestCase):
def test_gen_shared(self):
BASE_1 = 0x1111111111111111111111111111111111111111111111111111111111111111
BASE_2 = 0x1111111... | pk2) | self.assertEqual | variable | tests/ecdsa/encrypt_test.py | test_gen_shared | SharedPublicKeyTest | 19 | null |
richardkiss/pycoin | import threading
import unittest
from pycoin.encoding.hexbytes import h2b_rev
from pycoin.services import providers
from pycoin.services.blockchain_info import BlockchainInfoProvider
from pycoin.services.blockcypher import BlockcypherProvider
from pycoin.services.blockexplorer import BlockExplorerProvider
from pycoin.... | d["is_ok"]) | self.assertTrue | complex_expr | tests/services/services_test.py | test_thread_provider | ServicesTest | 52 | null |
richardkiss/pycoin | import binascii
import unittest
from pycoin.bloomfilter import filter_size_required, hash_function_count_required, BloomFilter, murmur3
from pycoin.symbols.btc import network
Spendable = network.tx.Spendable
h2b = binascii.unhexlify
class BloomFilterTest(unittest.TestCase):
def test_filter_size_required(self):... | ev) | self.assertEqual | variable | tests/bloomfilter_test.py | test_filter_size_required | BloomFilterTest | 21 | null |
richardkiss/pycoin | import unittest
from pycoin.encoding.hexbytes import h2b
from pycoin.symbols.btc import network as BTC
from pycoin.symbols.xtn import network as XTN
class Bip0032TestCase(unittest.TestCase):
def test_streams(self):
m0 = BTC.keys.bip32_seed(b"foo bar baz")
pm0 = m0.public_copy()
self.asser... | k2.hwif()) | self.assertEqual | func_call | tests/btc/bip32_test.py | test_streams | Bip0032TestCase | 216 | null |
richardkiss/pycoin | import io
import unittest
from pycoin.encoding.hexbytes import h2b
from pycoin.message.make_parser_and_packer import (
make_parser_and_packer, standard_messages, standard_message_post_unpacks,
standard_parsing_functions, standard_streamer
)
from pycoin.message.PeerAddress import ip_bin_to_ip4_addr, ip_bin_to_i... | ii1 > ii0) | self.assertTrue | complex_expr | tests/message_test.py | test_InvItem | MessageTest | 71 | null |
richardkiss/pycoin | from .encoding.hash import double_sha256
from .encoding.hexbytes import h2b_rev
def merkle(hashes, hash_f=double_sha256):
"""Take a list of hashes, and return the root merkle hash."""
while len(hashes) > 1:
hashes = merkle_pair(hashes, hash_f)
return hashes[0]
def merkle_pair(hashes, hash_f):
... | mr | assert | variable | pycoin/merkle.py | test_merkle | 30 | null | |
richardkiss/pycoin | import unittest
from pycoin.encoding.hexbytes import h2b
from pycoin.symbols.btc import network
class KeyTest(unittest.TestCase):
def do_test(exp_hex, wif, c_wif, public_pair_sec, c_public_pair_sec, address_b58, c_address_b58):
secret_exponent = int(exp_hex, 16)
sec = h2b(public_pair_... | sec) | self.assertEqual | variable | tests/key_test.py | do_test | KeyTest | 45 | null |
richardkiss/pycoin | import unittest
from pycoin.coins.bitcoin.SolutionChecker import TxContext
from pycoin.coins.bitcoin.VM import BitcoinVM
from pycoin.encoding.hexbytes import h2b
from pycoin.intbytes import int2byte
from pycoin.satoshi.opcodes import OPCODE_LIST
from pycoin.satoshi.IntStreamer import IntStreamer
from pycoin.symbols.bt... | s1) | self.assertEqual | variable | tests/tools_test.py | check | ToolsTest | 55 | null |
richardkiss/pycoin | import unittest
from pycoin.encoding.hexbytes import h2b
from pycoin.symbols.btc import network as BTC
from pycoin.symbols.xtn import network as XTN
class Bip0032TestCase(unittest.TestCase):
def test_streams(self):
m0 = BTC.keys.bip32_seed(b"foo bar baz")
pm0 = m0.public_copy()
self.asser... | m3.hwif()) | self.assertEqual | func_call | tests/btc/bip32_test.py | test_streams | Bip0032TestCase | 208 | null |
richardkiss/pycoin | import unittest
from pycoin.blockchain.ChainFinder import ChainFinder
def do_scramble(items, tfb, dbt):
import itertools
for c in itertools.permutations(items):
cf = ChainFinder()
load_items(cf, c)
assert cf.trees_from_bottom == | tfb | assert | variable | tests/chainfinder_test.py | do_scramble | 27 | null | |
richardkiss/pycoin | import io
import unittest
from pycoin.encoding.hexbytes import h2b
from pycoin.symbols.btc import network
Block = network.block
Tx = network.tx
flags = network.validator.flags
block_80971_cs = h2b('00000000001126456C67A1F5F0FF0268F53B4F22E0531DC70C7B69746AF69DAC')
block_80971_data = h2b(
"01000000950A1631FB9FAC4... | 0) | self.assertEqual | numeric_literal | tests/build_tx_test.py | test_build_spends | BuildTxTest | 162 | null |
richardkiss/pycoin | import unittest
from pycoin.cmds.tx import DEFAULT_VERSION
from pycoin.encoding.hexbytes import h2b
from pycoin.symbols.btc import network
Spendable = network.tx.Spendable
Tx = network.tx
TxIn = network.tx.TxIn
TxOut = network.tx.TxOut
class SignTest(unittest.TestCase):
def test_sign_p2sh(self):
tx_out_... | 1) | self.assertEqual | numeric_literal | tests/sign_test.py | test_sign_p2sh | SignTest | 24 | null |
richardkiss/pycoin | import unittest
from pycoin.symbols.btc import network
who_signed_tx = network.who_signed.who_signed_tx
Tx = network.tx
SIGHASH_ALL = network.validator.flags.SIGHASH_ALL
class WhoSignedTest(unittest.TestCase):
def multisig_M_of_N(self, M, N, unsigned_id, signed_id):
keys = [network.keys.private(secret_e... | ids[i]) | self.assertEqual | complex_expr | tests/who_signed_test.py | test_multisig_one_at_a_time | WhoSignedTest | 58 | null |
richardkiss/pycoin | import io
import unittest
from pycoin.encoding.hexbytes import h2b
from pycoin.message.make_parser_and_packer import (
make_parser_and_packer, standard_messages, standard_message_post_unpacks,
standard_parsing_functions, standard_streamer
)
from pycoin.message.PeerAddress import ip_bin_to_ip4_addr, ip_bin_to_i... | ii0 < ii1) | self.assertTrue | complex_expr | tests/message_test.py | test_InvItem | MessageTest | 70 | null |
richardkiss/pycoin | import textwrap
import unittest
from pycoin.symbols.btc import network as BTC
from pycoin.symbols.xtn import network as XTN
def test_against_myself():
"""
Test code that verifies against ourselves only. Useful but not so great.
"""
for wif, right_addr in [
('L4gXBvYrXHo59HLeyem94D... | msg | assert | variable | tests/msg_signing_test.py | test_against_myself | 32 | null | |
richardkiss/pycoin | import unittest
from pycoin.blockchain.BlockChain import BlockChain
def longest_block_chain(self):
c = []
for idx in range(self.length()):
c.append(self.hash_for_index(idx))
return c
def longest_locked_block_chain(self):
c = []
for idx in range(self.locked_length(), self.length()):
... | set() | assert | func_call | tests/blockchain_test.py | test_fork | BlockchainTestCase | 145 | null |
richardkiss/pycoin | import textwrap
import unittest
from pycoin.symbols.btc import network as BTC
from pycoin.symbols.xtn import network as XTN
def test_msg_parse():
"""
Test against real-world signatures found in the wild.
"""
# Output from brainwallet in "multibit" mode.
multibit = '''
-----BEGIN BITCOIN SIGN... | 'n2D9XsQX1mDpFGgYqsfmePTy61LJFQnXQM' | assert | string_literal | tests/msg_signing_test.py | test_msg_parse | 136 | null | |
richardkiss/pycoin | import unittest
from pycoin.ecdsa.secp256k1 import secp256k1_generator
from pycoin.ecdsa.intstream import to_bytes, from_bytes
class ECDSATestCase(unittest.TestCase):
def test_add(self):
G = secp256k1_generator
a, b = 2, 3
self.assertEqual(a * G + b * G, | (a + b) * G) | self.assertEqual | collection | tests/ecdsa/ecdsa_test.py | test_add | ECDSATestCase | 39 | null |
richardkiss/pycoin | import unittest
from pycoin.contrib.bech32m import bech32_decode, bech32_encode, decode, encode, Encoding
from pycoin.encoding.hexbytes import b2h
class Bech32Test(unittest.TestCase):
def test_bip350_vectors(self):
# from
# https://github.com/bitcoin/bips/blob/master/bip-0350.mediawiki
# #... | data) | self.assertIsNone | variable | tests/bech32_test.py | test_bip350_vectors | Bech32Test | 46 | null |
richardkiss/pycoin | import io
import pytest
import unittest
from pycoin.encoding.hexbytes import h2b
from pycoin.symbols.grs import network as GroestlcoinMainnet
pytest.importorskip('groestlcoin_hash')
BLOCK_HASH = '00000000000434d5b8d1c3308df7b6e3fd773657dfb28f5dd2f70854ef94cc66'
class GroestlcoinBlockTestCase(unittest.TestCase):
... | tx.is_coinbase()) | self.assertTrue | func_call | tests/grs/grs_block_test.py | test_block_txs | GroestlcoinBlockTestCase | 54 | null |
richardkiss/pycoin | import unittest
from pycoin.encoding.hexbytes import h2b, h2b_rev, b2h, b2h_rev
class HexbytesTest(unittest.TestCase):
def test_h2b(self):
h = "000102"
b = b"\x00\x01\x02"
self.assertEqual(h2b(h), b)
self.assertEqual(b2h(b), h)
self.assertEqual(h2b_rev(h), b[::-1])
... | "020100") | self.assertEqual | string_literal | tests/hexbytes.py | test_h2b | HexbytesTest | 14 | null |
richardkiss/pycoin | import binascii
import unittest
from pycoin.encoding.hexbytes import b2h, h2b_rev
from pycoin.symbols.btc import network
Tx = network.tx
TX_E1A18B843FC420734DEEB68FF6DF041A2585E1A0D7DBF3B82AAB98291A6D9952_HEX = (
"0100000001a8f57056b016d7d243fc0fc2a73f9146e7e4c7766ec6033b5ac4cb89c64e"
"19d0000000008a47304402... | "3KmkA7hvqG2wKkWUGz1BySioUywvcmdPLR") | self.assertEqual | string_literal | tests/tx_test.py | test_tx_api | TxTest | 32 | null |
richardkiss/pycoin | import io
import unittest
from pycoin.encoding.hexbytes import h2b
from pycoin.message.make_parser_and_packer import (
make_parser_and_packer, standard_messages, standard_message_post_unpacks,
standard_parsing_functions, standard_streamer
)
from pycoin.message.PeerAddress import ip_bin_to_ip4_addr, ip_bin_to_i... | kwargs | assert | variable | tests/message_test.py | test_make_parser_and_packer | MessageTest | 36 | null |
richardkiss/pycoin | import unittest
from pycoin.encoding.b58 import a2b_hashed_base58, b2a_hashed_base58
from pycoin.networks.registry import network_for_netcode
from pycoin.networks.registry import network_codes
from pycoin.symbols.btc import network as BTC
from pycoin.symbols.xtn import network as XTN
NETCODES = "BTC XTN DOGE".split()... | address) | self.assertEqual | variable | tests/key_validate_test.py | test_address_valid_btc | KeyUtilsTest | 31 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.