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
marcwebbie/passpie
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
train
train
tests/test_history.py
test_reset_doesnt_call_git_reset_hard_on_commit_when_not_found
assert
bool_literal
14
from passpie.history import ensure_git, Repository, InvalidGitRepositoryError def test_reset_doesnt_call_git_reset_hard_on_commit_when_not_found(mocker): MockRepo = mocker.patch('passpie.history.Repo') mock_repo = MockRepo() commits = [] mock_repo.iter_commits.return_value = commits index = len(com...
False
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
v2_extractor_at_anchor
marcwebbie/passpie
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
train
train
tests/test_history.py
test_git_init_creates_a_repo_on_path_commiting_with_message
assert_*
variable
13
from passpie.history import ensure_git, Repository, InvalidGitRepositoryError def test_git_init_creates_a_repo_on_path_commiting_with_message(mocker): MockRepo = mocker.patch('passpie.history.Repo') path = 'some_path' message = 'Initial commit' git = Repository(path) git.init(message=message) ...
path)
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
v2_extractor_at_anchor
marcwebbie/passpie
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
train
train
tests/test_history.py
test_git_init_creates_a_repo_on_path_commiting_with_message
assert_*
variable
15
from passpie.history import ensure_git, Repository, InvalidGitRepositoryError def test_git_init_creates_a_repo_on_path_commiting_with_message(mocker): MockRepo = mocker.patch('passpie.history.Repo') path = 'some_path' message = 'Initial commit' git = Repository(path) git.init(message=message) ...
message)
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
v2_extractor_at_anchor
marcwebbie/passpie
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
train
train
tests/test_history.py
test_commit_by_index_returns_found_commit_when_index_exists
assert
complex_expr
14
from passpie.history import ensure_git, Repository, InvalidGitRepositoryError def test_commit_by_index_returns_found_commit_when_index_exists(mocker): MockRepo = mocker.patch('passpie.history.Repo') mock_repo = MockRepo() commits = ['initial commit'] mock_repo.iter_commits.return_value = commits in...
commits[0]
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
v2_extractor_at_anchor
marcwebbie/passpie
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
train
train
tests/test_history.py
test_ensure_returns_specified_return_value_when_exception
assert
variable
14
from passpie.history import ensure_git, Repository, InvalidGitRepositoryError def test_ensure_returns_specified_return_value_when_exception(mocker): mocker.patch('passpie.history.which', return_value='/usr/bin/gpg') mock_logger = mocker.patch('passpie.history.logger') return_value = 'return value' @en...
return_value
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
v2_extractor_at_anchor
marcwebbie/passpie
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
train
train
tests/test_history.py
test_git_commit_list_has_expected_reversed_commits_with_index
assert
func_call
17
from passpie.history import ensure_git, Repository, InvalidGitRepositoryError def test_git_commit_list_has_expected_reversed_commits_with_index(mocker): MockRepo = mocker.patch('passpie.history.Repo') mock_repo = MockRepo() commits = [ 'another commit', 'initial commit' ] mock_repo....
len(commits)
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
v2_extractor_at_anchor
marcwebbie/passpie
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
train
train
tests/test_history.py
test_reset_call_git_reset_hard_on_commit_when_found
assert_*
complex_expr
15
from passpie.history import ensure_git, Repository, InvalidGitRepositoryError def test_reset_call_git_reset_hard_on_commit_when_found(mocker): MockRepo = mocker.patch('passpie.history.Repo') mock_repo = MockRepo() commits = [MagicMock()] mock_repo.iter_commits.return_value = commits index = 0 ...
commits[0].hexsha)
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
v2_extractor_at_anchor
marcwebbie/passpie
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
train
train
tests/test_history.py
test_git_commit_list_has_expected_reversed_commits_with_index
assert
func_call
18
from passpie.history import ensure_git, Repository, InvalidGitRepositoryError def test_git_commit_list_has_expected_reversed_commits_with_index(mocker): MockRepo = mocker.patch('passpie.history.Repo') mock_repo = MockRepo() commits = [ 'another commit', 'initial commit' ] mock_repo....
list(reversed(list(range(len(commits)))))
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
v2_extractor_at_anchor
marcwebbie/passpie
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
train
train
tests/test_importers.py
test_get_instances_returns_instances_of_all_found_importers
assert
numeric_literal
18
from collections import namedtuple import yaml from passpie.importers import find_importer, BaseImporter, get_instances from passpie.importers.default_importer import DefaultImporter from passpie.importers.pysswords_importer import PysswordsImporter def test_get_instances_returns_instances_of_all_found_importers(moc...
3
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
v2_extractor_at_anchor
marcwebbie/passpie
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
train
train
tests/test_importers.py
test_pysswords_handle_returns_empty_when_bad_passphrase
assert
collection
18
from collections import namedtuple import yaml from passpie.importers import find_importer, BaseImporter, get_instances from passpie.importers.default_importer import DefaultImporter from passpie.importers.pysswords_importer import PysswordsImporter def test_pysswords_handle_returns_empty_when_bad_passphrase(mocker)...
[]
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
v2_extractor_at_anchor
marcwebbie/passpie
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
train
train
tests/test_importers.py
test_default_importer_match_passpie_exported_yaml
assert
bool_literal
18
from collections import namedtuple import yaml from passpie.importers import find_importer, BaseImporter, get_instances from passpie.importers.default_importer import DefaultImporter from passpie.importers.pysswords_importer import PysswordsImporter def test_default_importer_match_passpie_exported_yaml(mocker): ...
True
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
v2_extractor_at_anchor
marcwebbie/passpie
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
train
train
tests/test_importers.py
test_default_importer_returns_false_when_bad_file
assert
bool_literal
16
from collections import namedtuple import yaml from passpie.importers import find_importer, BaseImporter, get_instances from passpie.importers.default_importer import DefaultImporter from passpie.importers.pysswords_importer import PysswordsImporter def test_default_importer_returns_false_when_bad_file(mocker): ...
False
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
v2_extractor_at_anchor
marcwebbie/passpie
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
train
train
tests/test_importers.py
test_base_importer_log_calls_logging_debug_with_message
assert_*
variable
17
from collections import namedtuple import yaml from passpie.importers import find_importer, BaseImporter, get_instances from passpie.importers.default_importer import DefaultImporter from passpie.importers.pysswords_importer import PysswordsImporter def test_base_importer_log_calls_logging_debug_with_message(mocker)...
message)
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
v2_extractor_at_anchor
marcwebbie/passpie
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
train
train
tests/test_importers.py
test_get_instances_returns_instances_of_all_found_importers
assert
variable
19
from collections import namedtuple import yaml from passpie.importers import find_importer, BaseImporter, get_instances from passpie.importers.default_importer import DefaultImporter from passpie.importers.pysswords_importer import PysswordsImporter def test_get_instances_returns_instances_of_all_found_importers(moc...
importers
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
v2_extractor_at_anchor
marcwebbie/passpie
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
train
train
tests/test_importers.py
test_find_importer_returns_first_match_default_importer
assert
variable
21
from collections import namedtuple import yaml from passpie.importers import find_importer, BaseImporter, get_instances from passpie.importers.default_importer import DefaultImporter from passpie.importers.pysswords_importer import PysswordsImporter def test_find_importer_returns_first_match_default_importer(mocker)...
mock_importer2
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
v2_extractor_at_anchor
marcwebbie/passpie
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
train
train
tests/test_importers.py
test_pysswords_returns_false_with_logging_when_path_not_dir
assert_*
string_literal
21
from collections import namedtuple import yaml from passpie.importers import find_importer, BaseImporter, get_instances from passpie.importers.default_importer import DefaultImporter from passpie.importers.pysswords_importer import PysswordsImporter def test_pysswords_returns_false_with_logging_when_path_not_dir(moc...
'.keys not found in path')
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
v2_extractor_at_anchor
marcwebbie/passpie
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
train
train
tests/test_utils.py
test_genpass_generates_a_password_with_length_32
self.assertEqual
numeric_literal
18
import yaml import pytest from passpie.utils import ( genpass, mkdir_open, load_config, get_version, ensure_dependencies ) from .helpers import MockerTestCase class UtilsTests(MockerTestCase): def test_genpass_generates_a_password_with_length_32(self): password = genpass() se...
32)
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
v2_extractor_at_anchor
marcwebbie/passpie
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
train
train
tests/test_utils.py
test_mkdir_open_handle_oserror_for_file_exist
self.assertIsNotNone
variable
23
import yaml import pytest from passpie.utils import ( genpass, mkdir_open, load_config, get_version, ensure_dependencies ) from .helpers import MockerTestCase class UtilsTests(MockerTestCase): def test_mkdir_open_handle_oserror_for_file_exist(self): mock_os = self.patch("passpie.utils...
fd)
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
v2_extractor_at_anchor
marcwebbie/passpie
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
train
train
tests/test_utils.py
test_get_version_uses_get_distribution_to_find_version
assert
string_literal
24
import yaml import pytest from passpie.utils import ( genpass, mkdir_open, load_config, get_version, ensure_dependencies ) from .helpers import MockerTestCase def test_get_version_uses_get_distribution_to_find_version(mocker): expected_version = '1.0' mock_dist = mocker.patch('passpie.util...
'1.0'
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
v2_extractor_at_anchor
marcwebbie/passpie
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
train
train
tests/test_utils.py
test_get_version_returns_install_message_when_dist_not_found
assert
variable
22
import yaml import pytest from passpie.utils import ( genpass, mkdir_open, load_config, get_version, ensure_dependencies ) from .helpers import MockerTestCase def test_get_version_returns_install_message_when_dist_not_found(mocker): message = 'Please install this project with setup.py or pip' ...
message
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
v2_extractor_at_anchor
marcwebbie/passpie
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
train
train
tests/test_utils.py
test_mkdir_open_makedirs_on_path_dirname
assert_*
variable
22
import yaml import pytest from passpie.utils import ( genpass, mkdir_open, load_config, get_version, ensure_dependencies ) from .helpers import MockerTestCase class UtilsTests(MockerTestCase): def test_mkdir_open_makedirs_on_path_dirname(self): mock_os = self.patch("passpie.utils.os")...
dirname)
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
v2_extractor_at_anchor
marcwebbie/passpie
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
train
train
tests/test_utils.py
test_mkdir_open_handle_oserror_for_file_exist
self.assertRaises
variable
26
import yaml import pytest from passpie.utils import ( genpass, mkdir_open, load_config, get_version, ensure_dependencies ) from .helpers import MockerTestCase class UtilsTests(MockerTestCase): def test_mkdir_open_handle_oserror_for_file_exist(self): mock_os = self.patch("passpie.utils...
OSError)
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
v2_extractor_at_anchor
marcwebbie/passpie
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
train
train
tests/test_utils.py
test_ensure_dependencies_raises_runtime_when_gpg_not_installed
pytest.raises
variable
17
import yaml import pytest from passpie.utils import ( genpass, mkdir_open, load_config, get_version, ensure_dependencies ) from .helpers import MockerTestCase def test_ensure_dependencies_raises_runtime_when_gpg_not_installed(mocker): mocker.patch('passpie.utils.which', return_value=None) ...
RuntimeError)
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
v2_extractor_at_anchor
marcwebbie/passpie
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
train
train
tests/test_utils.py
test_ensure_dependencies_raises_runtime_when_gpg_not_installed
assert
func_call
20
import yaml import pytest from passpie.utils import ( genpass, mkdir_open, load_config, get_version, ensure_dependencies ) from .helpers import MockerTestCase def test_ensure_dependencies_raises_runtime_when_gpg_not_installed(mocker): mocker.patch('passpie.utils.which', return_value=None) ...
str(excinfo.value)
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
v2_extractor_at_anchor
marcwebbie/passpie
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
train
train
tests/test_utils.py
test_load_config_replaces_sets_user_config_element
assert
complex_expr
24
import yaml import pytest from passpie.utils import ( genpass, mkdir_open, load_config, get_version, ensure_dependencies ) from .helpers import MockerTestCase def test_load_config_replaces_sets_user_config_element(mocker): DEFAULT_CONFIG = {'path': 'default_path', 'short_commands': True} U...
USER_CONFIG['path']
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
v2_extractor_at_anchor
marcwebbie/passpie
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
train
train
tests/test_utils.py
test_load_config_replaces_sets_user_config_element
assert
complex_expr
25
import yaml import pytest from passpie.utils import ( genpass, mkdir_open, load_config, get_version, ensure_dependencies ) from .helpers import MockerTestCase def test_load_config_replaces_sets_user_config_element(mocker): DEFAULT_CONFIG = {'path': 'default_path', 'short_commands': True} U...
DEFAULT_CONFIG['short_commands']
9091d6f1de7fa4702bd45ba2607c008084ddddcb
251
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_core.py
test_path_merges_paths
assert
variable
115
from collections import OrderedDict from http import HTTPStatus import pytest import yaml from apispec import APISpec, BasePlugin from apispec.exceptions import ( APISpecError, DuplicateComponentNameError, DuplicateParameterError, InvalidParameterError, ) from .utils import ( get_schemas, get...
p
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_core.py
test_response_with_status_code_range
assert
numeric_literal
102
from collections import OrderedDict from http import HTTPStatus import pytest import yaml from apispec import APISpec, BasePlugin from apispec.exceptions import ( APISpecError, DuplicateComponentNameError, DuplicateParameterError, InvalidParameterError, ) from .utils import ( get_schemas, get...
1
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_core.py
test_plugin_path_helper_is_used
assert
collection
77
from collections import OrderedDict from http import HTTPStatus import pytest import yaml from apispec import APISpec, BasePlugin from apispec.exceptions import ( APISpecError, DuplicateComponentNameError, DuplicateParameterError, InvalidParameterError, ) from .utils import ( get_schemas, get...
{}
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_core.py
test_schema_stores_enum
assert
variable
73
from collections import OrderedDict from http import HTTPStatus import pytest import yaml from apispec import APISpec, BasePlugin from apispec.exceptions import ( APISpecError, DuplicateComponentNameError, DuplicateParameterError, InvalidParameterError, ) from .utils import ( get_schemas, get...
enum
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_core.py
test_path_ensures_path_parameters_required
assert
bool_literal
99
from collections import OrderedDict from http import HTTPStatus import pytest import yaml from apispec import APISpec, BasePlugin from apispec.exceptions import ( APISpecError, DuplicateComponentNameError, DuplicateParameterError, InvalidParameterError, ) from .utils import ( get_schemas, get...
True
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_core.py
test_schema_discriminator
assert
string_literal
74
from collections import OrderedDict from http import HTTPStatus import pytest import yaml from apispec import APISpec, BasePlugin from apispec.exceptions import ( APISpecError, DuplicateComponentNameError, DuplicateParameterError, InvalidParameterError, ) from .utils import ( get_schemas, get...
"name"
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_core.py
test_parameter_is_chainable
assert
variable
72
from collections import OrderedDict from http import HTTPStatus import pytest import yaml from apispec import APISpec, BasePlugin from apispec.exceptions import ( APISpecError, DuplicateComponentNameError, DuplicateParameterError, InvalidParameterError, ) from .utils import ( get_schemas, get...
params
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_core.py
test_header
assert
variable
74
from collections import OrderedDict from http import HTTPStatus import pytest import yaml from apispec import APISpec, BasePlugin from apispec.exceptions import ( APISpecError, DuplicateComponentNameError, DuplicateParameterError, InvalidParameterError, ) from .utils import ( get_schemas, get...
header
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_core.py
test_openapi_metadata
assert
string_literal
66
from collections import OrderedDict from http import HTTPStatus import pytest import yaml from apispec import APISpec, BasePlugin from apispec.exceptions import ( APISpecError, DuplicateComponentNameError, DuplicateParameterError, InvalidParameterError, ) from .utils import ( get_schemas, get...
"1.0.0"
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_core.py
test_schema
assert
variable
72
from collections import OrderedDict from http import HTTPStatus import pytest import yaml from apispec import APISpec, BasePlugin from apispec.exceptions import ( APISpecError, DuplicateComponentNameError, DuplicateParameterError, InvalidParameterError, ) from .utils import ( get_schemas, get...
schemas
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_core.py
test_header_is_chainable
assert
variable
74
from collections import OrderedDict from http import HTTPStatus import pytest import yaml from apispec import APISpec, BasePlugin from apispec.exceptions import ( APISpecError, DuplicateComponentNameError, DuplicateParameterError, InvalidParameterError, ) from .utils import ( get_schemas, get...
headers
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_ext_marshmallow.py
test_schema_instance_with_different_modifers_custom_resolver
assert
numeric_literal
52
import json import pytest from marshmallow.fields import Field, DateTime, Dict, String, Nested, List from marshmallow import Schema from apispec import APISpec from apispec.ext.marshmallow import MarshmallowPlugin from apispec.ext.marshmallow import common from apispec.exceptions import APISpecError from .schemas im...
0
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_ext_marshmallow.py
test_schema_v2
assert
numeric_literal
82
import json import pytest from marshmallow.fields import Field, DateTime, Dict, String, Nested, List from marshmallow import Schema from apispec import APISpec from apispec.ext.marshmallow import MarshmallowPlugin from apispec.ext.marshmallow import common from apispec.exceptions import APISpecError from .schemas im...
1
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_ext_marshmallow.py
test_field_with_custom_props_passed_as_snake_case
assert
numeric_literal
38
import json import pytest from marshmallow.fields import Field, DateTime, Dict, String, Nested, List from marshmallow import Schema from apispec import APISpec from apispec.ext.marshmallow import MarshmallowPlugin from apispec.ext.marshmallow import common from apispec.exceptions import APISpecError from .schemas im...
2
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_ext_marshmallow.py
test_schema_with_default_values
assert
numeric_literal
37
import json import pytest from marshmallow.fields import Field, DateTime, Dict, String, Nested, List from marshmallow import Schema from apispec import APISpec from apispec.ext.marshmallow import MarshmallowPlugin from apispec.ext.marshmallow import common from apispec.exceptions import APISpecError from .schemas im...
12
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_ext_marshmallow.py
test_schema_with_default_values
assert
numeric_literal
38
import json import pytest from marshmallow.fields import Field, DateTime, Dict, String, Nested, List from marshmallow import Schema from apispec import APISpec from apispec.ext.marshmallow import MarshmallowPlugin from apispec.ext.marshmallow import common from apispec.exceptions import APISpecError from .schemas im...
42
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_ext_marshmallow.py
test_content_without_schema
assert
variable
33
import json import pytest from marshmallow.fields import Field, DateTime, Dict, String, Nested, List from marshmallow import Schema from apispec import APISpec from apispec.ext.marshmallow import MarshmallowPlugin from apispec.ext.marshmallow import common from apispec.exceptions import APISpecError from .schemas im...
resp
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_ext_marshmallow.py
test_schema_global_state_untouched_2json
assert
none_literal
47
import json import pytest from marshmallow.fields import Field, DateTime, Dict, String, Nested, List from marshmallow import Schema from apispec import APISpec from apispec.ext.marshmallow import MarshmallowPlugin from apispec.ext.marshmallow import common from apispec.exceptions import APISpecError from .schemas im...
None
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_ext_marshmallow.py
test_can_use_schema_in_parameter
assert
string_literal
35
import json import pytest from marshmallow.fields import Field, DateTime, Dict, String, Nested, List from marshmallow import Schema from apispec import APISpec from apispec.ext.marshmallow import MarshmallowPlugin from apispec.ext.marshmallow import common from apispec.exceptions import APISpecError from .schemas im...
"body"
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_ext_marshmallow_common.py
test_unique_name
assert
string_literal
21
import pytest from marshmallow import Schema, fields from apispec.ext.marshmallow.common import ( make_schema_key, get_unique_schema_name, get_fields, ) from .schemas import PetSchema, SampleSchema class TestUniqueName: def test_unique_name(self, spec): properties = { "id": {"type...
"Pet"
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_ext_marshmallow_common.py
test_unique_name
assert
string_literal
28
import pytest from marshmallow import Schema, fields from apispec.ext.marshmallow.common import ( make_schema_key, get_unique_schema_name, get_fields, ) from .schemas import PetSchema, SampleSchema class TestUniqueName: def test_unique_name(self, spec): properties = { "id": {"type...
"Pet1"
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_ext_marshmallow_common.py
test_unique_name
assert
string_literal
35
import pytest from marshmallow import Schema, fields from apispec.ext.marshmallow.common import ( make_schema_key, get_unique_schema_name, get_fields, ) from .schemas import PetSchema, SampleSchema class TestUniqueName: def test_unique_name(self, spec): properties = { "id": {"type...
"Pet2"
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_ext_marshmallow_common.py
test_same_schemas_instances_equal
assert
func_call
16
import pytest from marshmallow import Schema, fields from apispec.ext.marshmallow.common import ( make_schema_key, get_unique_schema_name, get_fields, ) from .schemas import PetSchema, SampleSchema class TestMakeSchemaKey: def test_same_schemas_instances_equal(self): assert make_schema_key(...
make_schema_key(PetSchema())
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_ext_marshmallow_common.py
test_get_fields_meta_exclude_dump_only_as_list_and_tuple
assert
collection
31
import pytest from marshmallow import Schema, fields from apispec.ext.marshmallow.common import ( make_schema_key, get_unique_schema_name, get_fields, ) from .schemas import PetSchema, SampleSchema class TestGetFields: @pytest.mark.parametrize("exclude_type", (tuple, list)) @pytest.mark.parametri...
["field3", "field4", "field5"]
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_ext_marshmallow_common.py
test_different_schemas_not_equal
assert
func_call
16
import pytest from marshmallow import Schema, fields from apispec.ext.marshmallow.common import ( make_schema_key, get_unique_schema_name, get_fields, ) from .schemas import PetSchema, SampleSchema class TestMakeSchemaKey: def test_different_schemas_not_equal(self): assert make_schema_key(P...
make_schema_key(SampleSchema())
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_ext_marshmallow_common.py
test_instances_with_different_modifiers_not_equal
assert
func_call
16
import pytest from marshmallow import Schema, fields from apispec.ext.marshmallow.common import ( make_schema_key, get_unique_schema_name, get_fields, ) from .schemas import PetSchema, SampleSchema class TestMakeSchemaKey: def test_instances_with_different_modifiers_not_equal(self): assert ...
make_schema_key(PetSchema(partial=True))
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_ext_marshmallow_common.py
test_raise_if_schema_class_passed
pytest.raises
complex_expr
15
import pytest from marshmallow import Schema, fields from apispec.ext.marshmallow.common import ( make_schema_key, get_unique_schema_name, get_fields, ) from .schemas import PetSchema, SampleSchema class TestMakeSchemaKey: def test_raise_if_schema_class_passed(self): with pytest.raises(
TypeError, match="based on a Schema instance")
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_ext_marshmallow_common.py
test_same_schemas_instances_unhashable_modifiers_equal
assert
func_call
18
import pytest from marshmallow import Schema, fields from apispec.ext.marshmallow.common import ( make_schema_key, get_unique_schema_name, get_fields, ) from .schemas import PetSchema, SampleSchema class TestMakeSchemaKey: @pytest.mark.parametrize("structure", (list, set)) def test_same_schemas_...
make_schema_key(PetSchema(load_only=structure(modifier[::-1])))
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_ext_marshmallow_common.py
test_get_fields_meta_exclude_dump_only_as_list_and_tuple
assert
collection
32
import pytest from marshmallow import Schema, fields from apispec.ext.marshmallow.common import ( make_schema_key, get_unique_schema_name, get_fields, ) from .schemas import PetSchema, SampleSchema class TestGetFields: @pytest.mark.parametrize("exclude_type", (tuple, list)) @pytest.mark.parametri...
[ "field5" ]
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_ext_marshmallow_field.py
test_field_with_additional_metadata
assert
numeric_literal
15
import datetime as dt import re import pytest from marshmallow import fields, validate from .schemas import CategorySchema, CustomList, CustomStringField, CustomIntegerField from .utils import build_ref def test_field_with_additional_metadata(spec_fixture): field = fields.Str(minLength=6, maxLength=100) res ...
6
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_ext_marshmallow_field.py
test_field_with_doc_default_and_missing
assert
numeric_literal
14
import datetime as dt import re import pytest from marshmallow import fields, validate from .schemas import CategorySchema, CustomList, CustomStringField, CustomIntegerField from .utils import build_ref def test_field_with_doc_default_and_missing(spec_fixture): field = fields.Int(doc_default=42, missing=12) ...
42
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_ext_marshmallow_field.py
test_field2property_no_type_
assert
variable
15
import datetime as dt import re import pytest from marshmallow import fields, validate from .schemas import CategorySchema, CustomList, CustomStringField, CustomIntegerField from .utils import build_ref @pytest.mark.parametrize("FieldClass", [fields.Field, fields.Raw]) def test_field2property_no_type_(FieldClass, sp...
res
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_ext_marshmallow_field.py
test_field_with_additional_metadata
assert
numeric_literal
14
import datetime as dt import re import pytest from marshmallow import fields, validate from .schemas import CategorySchema, CustomList, CustomStringField, CustomIntegerField from .utils import build_ref def test_field_with_additional_metadata(spec_fixture): field = fields.Str(minLength=6, maxLength=100) res ...
100
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_ext_marshmallow_field.py
test_field_with_no_pattern
assert
variable
14
import datetime as dt import re import pytest from marshmallow import fields, validate from .schemas import CategorySchema, CustomList, CustomStringField, CustomIntegerField from .utils import build_ref def test_field_with_no_pattern(spec_fixture): field = fields.Str() ret = spec_fixture.openapi.field2proper...
ret
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_ext_marshmallow_field.py
test_field_with_allow_none
assert
bool_literal
15
import datetime as dt import re import pytest from marshmallow import fields, validate from .schemas import CategorySchema, CustomList, CustomStringField, CustomIntegerField from .utils import build_ref def test_field_with_allow_none(spec_fixture): field = fields.Str(allow_none=True) res = spec_fixture.opena...
True
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_ext_marshmallow_field.py
test_field_with_missing
assert
string_literal
14
import datetime as dt import re import pytest from marshmallow import fields, validate from .schemas import CategorySchema, CustomList, CustomStringField, CustomIntegerField from .utils import build_ref def test_field_with_missing(spec_fixture): field = fields.Str(default="foo", missing="bar") res = spec_fix...
"bar"
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_ext_marshmallow_field.py
test_boolean_field_with_false_missing
assert
bool_literal
14
import datetime as dt import re import pytest from marshmallow import fields, validate from .schemas import CategorySchema, CustomList, CustomStringField, CustomIntegerField from .utils import build_ref def test_boolean_field_with_false_missing(spec_fixture): field = fields.Boolean(default=None, missing=False) ...
False
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_ext_marshmallow_field.py
test_formatted_field_translates_to_array
assert
string_literal
15
import datetime as dt import re import pytest from marshmallow import fields, validate from .schemas import CategorySchema, CustomList, CustomStringField, CustomIntegerField from .utils import build_ref @pytest.mark.parametrize("ListClass", [fields.List, CustomList]) def test_formatted_field_translates_to_array(List...
"array"
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_ext_marshmallow_field.py
test_field2property_type
assert
variable
35
import datetime as dt import re import pytest from marshmallow import fields, validate from .schemas import CategorySchema, CustomList, CustomStringField, CustomIntegerField from .utils import build_ref @pytest.mark.parametrize( ("FieldClass", "jsontype"), [ (fields.Integer, "integer"), (fiel...
jsontype
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_ext_marshmallow_field.py
test_field_with_multiple_patterns
assert
string_literal
16
import datetime as dt import re import pytest from marshmallow import fields, validate from .schemas import CategorySchema, CustomList, CustomStringField, CustomIntegerField from .utils import build_ref def test_field_with_multiple_patterns(recwarn, spec_fixture): regex_validators = [validate.Regexp("winner"), v...
"winner"
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_ext_marshmallow_field.py
test_field_with_str_regex
assert
variable
15
import datetime as dt import re import pytest from marshmallow import fields, validate from .schemas import CategorySchema, CustomList, CustomStringField, CustomIntegerField from .utils import build_ref def test_field_with_str_regex(spec_fixture): regex_str = "^[a-zA-Z0-9]$" field = fields.Str(validate=valid...
regex_str
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_ext_marshmallow_openapi.py
test_fields_with_dump_only
assert
numeric_literal
20
import pytest from datetime import datetime from marshmallow import EXCLUDE, fields, INCLUDE, RAISE, Schema, validate from apispec.ext.marshmallow import MarshmallowPlugin from apispec import exceptions, utils, APISpec from .schemas import CustomList, CustomStringField from .utils import get_schemas, build_ref clas...
0
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_ext_marshmallow_openapi.py
test_schema_body
assert
numeric_literal
22
import pytest from datetime import datetime from marshmallow import EXCLUDE, fields, INCLUDE, RAISE, Schema, validate from apispec.ext.marshmallow import MarshmallowPlugin from apispec import exceptions, utils, APISpec from .schemas import CustomList, CustomStringField from .utils import get_schemas, build_ref clas...
1
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_ext_marshmallow_openapi.py
test_schema_query
assert
numeric_literal
21
import pytest from datetime import datetime from marshmallow import EXCLUDE, fields, INCLUDE, RAISE, Schema, validate from apispec.ext.marshmallow import MarshmallowPlugin from apispec import exceptions, utils, APISpec from .schemas import CustomList, CustomStringField from .utils import get_schemas, build_ref clas...
2
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_ext_marshmallow_openapi.py
test_partial
assert
variable
21
import pytest from datetime import datetime from marshmallow import EXCLUDE, fields, INCLUDE, RAISE, Schema, validate from apispec.ext.marshmallow import MarshmallowPlugin from apispec import exceptions, utils, APISpec from .schemas import CustomList, CustomStringField from .utils import get_schemas, build_ref clas...
res
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_ext_marshmallow_openapi.py
test_unknown_values_allow
assert
bool_literal
23
import pytest from datetime import datetime from marshmallow import EXCLUDE, fields, INCLUDE, RAISE, Schema, validate from apispec.ext.marshmallow import MarshmallowPlugin from apispec import exceptions, utils, APISpec from .schemas import CustomList, CustomStringField from .utils import get_schemas, build_ref clas...
True
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_ext_marshmallow_openapi.py
test_unknown_values_disallow
assert
bool_literal
23
import pytest from datetime import datetime from marshmallow import EXCLUDE, fields, INCLUDE, RAISE, Schema, validate from apispec.ext.marshmallow import MarshmallowPlugin from apispec import exceptions, utils, APISpec from .schemas import CustomList, CustomStringField from .utils import get_schemas, build_ref clas...
False
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_ext_marshmallow_openapi.py
test_schema_instance_inspection
assert
variable
23
import pytest from datetime import datetime from marshmallow import EXCLUDE, fields, INCLUDE, RAISE, Schema, validate from apispec.ext.marshmallow import MarshmallowPlugin from apispec import exceptions, utils, APISpec from .schemas import CustomList, CustomStringField from .utils import get_schemas, build_ref clas...
props
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_ext_marshmallow_openapi.py
test_fields_with_missing_load
assert
string_literal
20
import pytest from datetime import datetime from marshmallow import EXCLUDE, fields, INCLUDE, RAISE, Schema, validate from apispec.ext.marshmallow import MarshmallowPlugin from apispec import exceptions, utils, APISpec from .schemas import CustomList, CustomStringField from .utils import get_schemas, build_ref clas...
"bar"
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_utils.py
test_openapi_version_digits
assert
numeric_literal
11
import pytest from apispec import utils from apispec.exceptions import APISpecError class TestOpenAPIVersion: def test_openapi_version_digits(self): ver = utils.OpenAPIVersion("3.0.1") assert ver.major ==
3
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_utils.py
test_openapi_version_digits
assert
numeric_literal
12
import pytest from apispec import utils from apispec.exceptions import APISpecError class TestOpenAPIVersion: def test_openapi_version_digits(self): ver = utils.OpenAPIVersion("3.0.1") assert ver.major == 3 assert ver.minor ==
0
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_utils.py
test_openapi_version_digits
assert
numeric_literal
13
import pytest from apispec import utils from apispec.exceptions import APISpecError class TestOpenAPIVersion: def test_openapi_version_digits(self): ver = utils.OpenAPIVersion("3.0.1") assert ver.major == 3 assert ver.minor == 0 assert ver.patch ==
1
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_utils.py
test_openapi_version_digits
assert
string_literal
14
import pytest from apispec import utils from apispec.exceptions import APISpecError class TestOpenAPIVersion: def test_openapi_version_digits(self): ver = utils.OpenAPIVersion("3.0.1") assert ver.major == 3 assert ver.minor == 0 assert ver.patch == 1 assert ver.vstring ==...
"3.0.1"
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_utils.py
test_build_reference
assert
collection
12
import pytest from apispec import utils from apispec.exceptions import APISpecError def test_build_reference(): assert utils.build_reference("schema", 2, "Test") == {"$ref": "#/definitions/Test"} assert utils.build_reference("parameter", 2, "Test") == { "$ref": "#/parameters/Test" } assert ut...
{"$ref": "#/responses/Test"}
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_utils.py
test_openapi_version_invalid_version
pytest.raises
complex_expr
11
import pytest from apispec import utils from apispec.exceptions import APISpecError class TestOpenAPIVersion: @pytest.mark.parametrize("version", ("1.0", "4.0")) def test_openapi_version_invalid_version(self, version): message = "Not a valid OpenAPI version number:" with pytest.raises(
APISpecError, match=message)
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_utils.py
test_openapi_version_string_or_openapi_version_param
assert
func_call
11
import pytest from apispec import utils from apispec.exceptions import APISpecError class TestOpenAPIVersion: @pytest.mark.parametrize("version", ("3.0.1", utils.OpenAPIVersion("3.0.1"))) def test_openapi_version_string_or_openapi_version_param(self, version): assert utils.OpenAPIVersion(version) ==...
utils.OpenAPIVersion("3.0.1")
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_utils.py
test_build_reference
assert
collection
8
import pytest from apispec import utils from apispec.exceptions import APISpecError def test_build_reference(): assert utils.build_reference("schema", 2, "Test") ==
{"$ref": "#/definitions/Test"}
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_utils.py
test_build_reference
assert
collection
9
import pytest from apispec import utils from apispec.exceptions import APISpecError def test_build_reference(): assert utils.build_reference("schema", 2, "Test") == {"$ref": "#/definitions/Test"} assert utils.build_reference("parameter", 2, "Test") ==
{ "$ref": "#/parameters/Test" }
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_utils.py
test_build_reference
assert
collection
16
import pytest from apispec import utils from apispec.exceptions import APISpecError def test_build_reference(): assert utils.build_reference("schema", 2, "Test") == {"$ref": "#/definitions/Test"} assert utils.build_reference("parameter", 2, "Test") == { "$ref": "#/parameters/Test" } assert uti...
{ "$ref": "#/components/schemas/Test" }
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_utils.py
test_build_reference
assert
collection
13
import pytest from apispec import utils from apispec.exceptions import APISpecError def test_build_reference(): assert utils.build_reference("schema", 2, "Test") == {"$ref": "#/definitions/Test"} assert utils.build_reference("parameter", 2, "Test") == { "$ref": "#/parameters/Test" } assert uti...
{ "$ref": "#/securityDefinitions/Test" }
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_yaml_utils.py
test_load_yaml_from_docstring_empty_docstring
assert
collection
7
import pytest from apispec import yaml_utils @pytest.mark.parametrize("docstring", (None, "", "---")) def test_load_yaml_from_docstring_empty_docstring(docstring): assert yaml_utils.load_yaml_from_docstring(docstring) ==
{}
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_yaml_utils.py
test_dict_to_yaml_unicode
assert
string_literal
7
import pytest from apispec import yaml_utils def test_dict_to_yaml_unicode(): assert yaml_utils.dict_to_yaml({"가": "나"}) == '"\\uAC00": "\\uB098"\n' assert yaml_utils.dict_to_yaml({"가": "나"}, {"allow_unicode": True}) == "가:
"가: 나\n"
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_yaml_utils.py
test_load_yaml_from_docstring
assert
collection
18
import pytest from apispec import yaml_utils def test_load_yaml_from_docstring(): def f(): """ Foo bar baz quux --- herp: 1 derp: 2 """ result = yaml_utils.load_yaml_from_docstring(f.__doc__) assert result ==
{"herp": 1, "derp": 2}
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/apispec
ccc532781da00e8b5554a2ad2970988bc9895807
218
train
train
tests/test_yaml_utils.py
test_dict_to_yaml_unicode
assert
string_literal
6
import pytest from apispec import yaml_utils def test_dict_to_yaml_unicode(): assert yaml_utils.dict_to_yaml({"가": "나"}) == '"\\
'"\\uAC00": "\\uB098"\n'
ccc532781da00e8b5554a2ad2970988bc9895807
218
v2_extractor_at_anchor
marshmallow-code/webargs
e4abfc9cd92fbc8ed17f4b2509f97bc00eb34dcf
173
train
train
src/webargs/testing.py
test_parse_json_many_schema_ignore_malformed_data
assert
collection
28
import pytest import webtest from webargs.core import json class CommonTestCase(object): def create_app(self): """Return a WSGI app""" raise NotImplementedError("Must define create_app()") def create_testapp(self, app): return webtest.TestApp(app) def before_create_app(self): ...
[]
e4abfc9cd92fbc8ed17f4b2509f97bc00eb34dcf
173
v2_extractor_at_anchor
marshmallow-code/webargs
e4abfc9cd92fbc8ed17f4b2509f97bc00eb34dcf
173
train
train
src/webargs/testing.py
test_parse_nested_many_missing
assert
collection
30
import pytest import webtest from webargs.core import json class CommonTestCase(object): def create_app(self): """Return a WSGI app""" raise NotImplementedError("Must define create_app()") def create_testapp(self, app): return webtest.TestApp(app) def before_create_app(self): ...
{}
e4abfc9cd92fbc8ed17f4b2509f97bc00eb34dcf
173
v2_extractor_at_anchor
marshmallow-code/webargs
e4abfc9cd92fbc8ed17f4b2509f97bc00eb34dcf
173
train
train
src/webargs/testing.py
test_parse_json_many_schema_invalid_input
assert
numeric_literal
31
import pytest import webtest from webargs.core import json class CommonTestCase(object): def create_app(self): """Return a WSGI app""" raise NotImplementedError("Must define create_app()") def create_testapp(self, app): return webtest.TestApp(app) def before_create_app(self): ...
422
e4abfc9cd92fbc8ed17f4b2509f97bc00eb34dcf
173
v2_extractor_at_anchor
marshmallow-code/webargs
e4abfc9cd92fbc8ed17f4b2509f97bc00eb34dcf
173
train
train
src/webargs/testing.py
test_use_args_with_validation
assert
numeric_literal
29
import pytest import webtest from webargs.core import json class CommonTestCase(object): def create_app(self): """Return a WSGI app""" raise NotImplementedError("Must define create_app()") def create_testapp(self, app): return webtest.TestApp(app) def before_create_app(self): ...
200
e4abfc9cd92fbc8ed17f4b2509f97bc00eb34dcf
173
v2_extractor_at_anchor
marshmallow-code/webargs
e4abfc9cd92fbc8ed17f4b2509f97bc00eb34dcf
173
train
train
src/webargs/testing.py
test_invalid_json
assert
numeric_literal
34
import pytest import webtest from webargs.core import json class CommonTestCase(object): def create_app(self): """Return a WSGI app""" raise NotImplementedError("Must define create_app()") def create_testapp(self, app): return webtest.TestApp(app) def before_create_app(self): ...
400
e4abfc9cd92fbc8ed17f4b2509f97bc00eb34dcf
173
v2_extractor_at_anchor
marshmallow-code/webargs
e4abfc9cd92fbc8ed17f4b2509f97bc00eb34dcf
173
train
train
src/webargs/testing.py
test_parse_nested_many_json
assert
variable
30
import pytest import webtest from webargs.core import json class CommonTestCase(object): def create_app(self): """Return a WSGI app""" raise NotImplementedError("Must define create_app()") def create_testapp(self, app): return webtest.TestApp(app) def before_create_app(self): ...
in_data
e4abfc9cd92fbc8ed17f4b2509f97bc00eb34dcf
173
v2_extractor_at_anchor
marshmallow-code/webargs
e4abfc9cd92fbc8ed17f4b2509f97bc00eb34dcf
173
train
train
src/webargs/testing.py
test_parse_querystring_multiple
assert
variable
29
import pytest import webtest from webargs.core import json class CommonTestCase(object): def create_app(self): """Return a WSGI app""" raise NotImplementedError("Must define create_app()") def create_testapp(self, app): return webtest.TestApp(app) def before_create_app(self): ...
expected
e4abfc9cd92fbc8ed17f4b2509f97bc00eb34dcf
173
v2_extractor_at_anchor
marshmallow-code/webargs
e4abfc9cd92fbc8ed17f4b2509f97bc00eb34dcf
173
train
train
src/webargs/testing.py
test_use_args_with_path_param
assert
collection
30
import pytest import webtest from webargs.core import json class CommonTestCase(object): def create_app(self): """Return a WSGI app""" raise NotImplementedError("Must define create_app()") def create_testapp(self, app): return webtest.TestApp(app) def before_create_app(self): ...
{"value": 42}
e4abfc9cd92fbc8ed17f4b2509f97bc00eb34dcf
173
v2_extractor_at_anchor
marshmallow-code/webargs
e4abfc9cd92fbc8ed17f4b2509f97bc00eb34dcf
173
train
train
src/webargs/testing.py
test_parse_json_with_nonascii_chars
assert
collection
29
import pytest import webtest from webargs.core import json class CommonTestCase(object): def create_app(self): """Return a WSGI app""" raise NotImplementedError("Must define create_app()") def create_testapp(self, app): return webtest.TestApp(app) def before_create_app(self): ...
{"name": text}
e4abfc9cd92fbc8ed17f4b2509f97bc00eb34dcf
173
v2_extractor_at_anchor
marshmallow-code/webargs
e4abfc9cd92fbc8ed17f4b2509f97bc00eb34dcf
173
train
train
src/webargs/testing.py
test_parse_form
assert
collection
28
import pytest import webtest from webargs.core import json class CommonTestCase(object): def create_app(self): """Return a WSGI app""" raise NotImplementedError("Must define create_app()") def create_testapp(self, app): return webtest.TestApp(app) def before_create_app(self): ...
{"name": "Joe"}
e4abfc9cd92fbc8ed17f4b2509f97bc00eb34dcf
173
v2_extractor_at_anchor