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
python-attrs/attrs
724bb9a6ca1570b40e933e8375e267421ae1be3f
303
train
train
tests/test_slots.py
test_inheritance
assert
variable
44
import pickle import sys import types import weakref from unittest import mock import pytest import attr from attr._compat import PYPY, just_warn, make_set_closure_cell class TestClosureCellRewriting: def test_inheritance(self): """ Slotted classes support proper closure cell rewriting when in...
C2
724bb9a6ca1570b40e933e8375e267421ae1be3f
303
v2_extractor_at_anchor
python-attrs/attrs
724bb9a6ca1570b40e933e8375e267421ae1be3f
303
train
train
tests/test_slots.py
test_pickleable_by_default
assert
variable
61
import pickle import sys import types import weakref from unittest import mock import pytest import attr from attr._compat import PYPY, just_warn, make_set_closure_cell def tests_weakref_does_not_add_when_inheriting_with_weakref(): """ `weakref_slot=True` does not add a new __weakref__ slot when inheriting...
i2
724bb9a6ca1570b40e933e8375e267421ae1be3f
303
v2_extractor_at_anchor
python-attrs/attrs
724bb9a6ca1570b40e933e8375e267421ae1be3f
303
train
train
tests/test_utils.py
test_returns_distinct_classes
assert
func_call
10
from .utils import simple_class class TestSimpleClass: def test_returns_distinct_classes(self): """ Each call returns a completely new class. """ assert simple_class() is not
simple_class()
724bb9a6ca1570b40e933e8375e267421ae1be3f
303
v2_extractor_at_anchor
python-attrs/attrs
724bb9a6ca1570b40e933e8375e267421ae1be3f
303
train
train
tests/test_utils.py
test_returns_class
assert
func_call
10
from .utils import simple_class class TestSimpleClass: def test_returns_class(self): """ Returns a class object. """ assert type is
simple_class().__class__
724bb9a6ca1570b40e933e8375e267421ae1be3f
303
v2_extractor_at_anchor
python-attrs/attrs
724bb9a6ca1570b40e933e8375e267421ae1be3f
303
train
train
tests/test_validators.py
test_default
assert
bool_literal
56
import re import pytest import attr from attr import _config, fields, has from attr import validators as validator_module from attr.validators import ( _subclass_of, and_, deep_iterable, deep_mapping, ge, gt, in_, instance_of, is_callable, le, lt, matches_re, max_l...
True
724bb9a6ca1570b40e933e8375e267421ae1be3f
303
v2_extractor_at_anchor
python-attrs/attrs
724bb9a6ca1570b40e933e8375e267421ae1be3f
303
train
train
tests/test_validators.py
test_hashability
assert
none_literal
84
import re import pytest import attr from attr import _config, fields, has from attr import validators as validator_module from attr.validators import ( _subclass_of, and_, deep_iterable, deep_mapping, ge, gt, in_, instance_of, is_callable, le, lt, matches_re, max_l...
None
724bb9a6ca1570b40e933e8375e267421ae1be3f
303
v2_extractor_at_anchor
python-attrs/attrs
724bb9a6ca1570b40e933e8375e267421ae1be3f
303
train
train
tests/test_validators.py
test_disabled_ctx
assert
bool_literal
60
import re import pytest import attr from attr import _config, fields, has from attr import validators as validator_module from attr.validators import ( _subclass_of, and_, deep_iterable, deep_mapping, ge, gt, in_, instance_of, is_callable, le, lt, matches_re, max_l...
False
724bb9a6ca1570b40e933e8375e267421ae1be3f
303
v2_extractor_at_anchor
python-attrs/attrs
724bb9a6ca1570b40e933e8375e267421ae1be3f
303
train
train
tests/test_validators.py
test_repr
assert
func_call
50
import re import pytest import attr from attr import _config, fields, has from attr import validators as validator_module from attr.validators import ( _subclass_of, and_, deep_iterable, deep_mapping, ge, gt, in_, instance_of, is_callable, le, lt, matches_re, max_l...
repr(v)
724bb9a6ca1570b40e933e8375e267421ae1be3f
303
v2_extractor_at_anchor
python-attrs/attrs
724bb9a6ca1570b40e933e8375e267421ae1be3f
303
train
train
tests/test_validators.py
test_set_validators_disabled
assert
variable
59
import re import pytest import attr from attr import _config, fields, has from attr import validators as validator_module from attr.validators import ( _subclass_of, and_, deep_iterable, deep_mapping, ge, gt, in_, instance_of, is_callable, le, lt, matches_re, max_l...
expected
724bb9a6ca1570b40e933e8375e267421ae1be3f
303
v2_extractor_at_anchor
python-attrs/attrs
724bb9a6ca1570b40e933e8375e267421ae1be3f
303
train
train
tests/test_validators.py
test_fail
pytest.raises
variable
51
import re import pytest import attr from attr import _config, fields, has from attr import validators as validator_module from attr.validators import ( _subclass_of, and_, deep_iterable, deep_mapping, ge, gt, in_, instance_of, is_callable, le, lt, matches_re, max_l...
TypeError)
724bb9a6ca1570b40e933e8375e267421ae1be3f
303
v2_extractor_at_anchor
python-attrs/attrs
724bb9a6ca1570b40e933e8375e267421ae1be3f
303
train
train
tests/test_version_info.py
test_order
assert
collection
17
import pytest from attr import VersionInfo def fixture_vi(): return VersionInfo(19, 2, 0, "final") class TestVersionInfo: def test_order(self, vi): """ Ordering works as expected. """ assert vi < (20,) assert vi < (19, 2, 1) assert vi >
(0,)
724bb9a6ca1570b40e933e8375e267421ae1be3f
303
v2_extractor_at_anchor
python-attrs/attrs
724bb9a6ca1570b40e933e8375e267421ae1be3f
303
train
train
tests/test_version_info.py
test_wrong_len
assert
variable
16
import pytest from attr import VersionInfo def fixture_vi(): return VersionInfo(19, 2, 0, "final") class TestVersionInfo: @pytest.mark.parametrize("other", [(), (19, 2, 0, "final", "garbage")]) def test_wrong_len(self, vi, other): """ Comparing with a tuple that has the wrong length rais...
other
724bb9a6ca1570b40e933e8375e267421ae1be3f
303
v2_extractor_at_anchor
python-attrs/attrs
724bb9a6ca1570b40e933e8375e267421ae1be3f
303
train
train
tests/test_version_info.py
test_order
assert
collection
15
import pytest from attr import VersionInfo def fixture_vi(): return VersionInfo(19, 2, 0, "final") class TestVersionInfo: def test_order(self, vi): """ Ordering works as expected. """ assert vi <
(20,)
724bb9a6ca1570b40e933e8375e267421ae1be3f
303
v2_extractor_at_anchor
python-attrs/attrs
724bb9a6ca1570b40e933e8375e267421ae1be3f
303
train
train
tests/test_version_info.py
test_order
assert
collection
18
import pytest from attr import VersionInfo def fixture_vi(): return VersionInfo(19, 2, 0, "final") class TestVersionInfo: def test_order(self, vi): """ Ordering works as expected. """ assert vi < (20,) assert vi < (19, 2, 1) assert vi > (0,) assert vi...
(19, 2)
724bb9a6ca1570b40e933e8375e267421ae1be3f
303
v2_extractor_at_anchor
python-attrs/attrs
724bb9a6ca1570b40e933e8375e267421ae1be3f
303
train
train
tests/test_version_info.py
test_wrong_len
pytest.raises
variable
18
import pytest from attr import VersionInfo def fixture_vi(): return VersionInfo(19, 2, 0, "final") class TestVersionInfo: @pytest.mark.parametrize("other", [(), (19, 2, 0, "final", "garbage")]) def test_wrong_len(self, vi, other): """ Comparing with a tuple that has the wrong length rais...
TypeError)
724bb9a6ca1570b40e933e8375e267421ae1be3f
303
v2_extractor_at_anchor
python-attrs/attrs
724bb9a6ca1570b40e933e8375e267421ae1be3f
303
train
train
tests/test_version_info.py
test_order
assert
collection
16
import pytest from attr import VersionInfo def fixture_vi(): return VersionInfo(19, 2, 0, "final") class TestVersionInfo: def test_order(self, vi): """ Ordering works as expected. """ assert vi < (20,) assert vi <
(19, 2, 1)
724bb9a6ca1570b40e933e8375e267421ae1be3f
303
v2_extractor_at_anchor
python-attrs/attrs
724bb9a6ca1570b40e933e8375e267421ae1be3f
303
train
train
tests/test_version_info.py
test_from_string_no_releaselevel
assert
func_call
14
import pytest from attr import VersionInfo def fixture_vi(): return VersionInfo(19, 2, 0, "final") class TestVersionInfo: def test_from_string_no_releaselevel(self, vi): """ If there is no suffix, the releaselevel becomes "final" by default. """ assert vi ==
VersionInfo._from_version_string("19.2.0")
724bb9a6ca1570b40e933e8375e267421ae1be3f
303
v2_extractor_at_anchor
python-attrs/attrs
724bb9a6ca1570b40e933e8375e267421ae1be3f
303
train
train
tests/test_version_info.py
test_suffix_is_preserved
assert
func_call
15
import pytest from attr import VersionInfo def fixture_vi(): return VersionInfo(19, 2, 0, "final") class TestVersionInfo: def test_suffix_is_preserved(self): """ If there is a suffix, it's preserved. """ assert
VersionInfo._from_version_string("19.2.0.dev0").releaselevel
724bb9a6ca1570b40e933e8375e267421ae1be3f
303
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_abstract_base_class.py
test_abstract_base_class
assert
variable
11
from abc import ABCMeta import pytest import escpos.escpos as escpos def test_abstract_base_class(): """test whether Escpos has the metaclass ABCMeta""" assert issubclass(escpos.Escpos, object) assert type(escpos.Escpos) is
ABCMeta
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_abstract_base_class.py
test_abstract_base_class_raises
pytest.raises
variable
10
from abc import ABCMeta import pytest import escpos.escpos as escpos def test_abstract_base_class_raises(): """test whether the abstract base class raises an exception for ESC/POS""" with pytest.raises(
TypeError)
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_cli.py
test_cli_text_invalid_args
assert
numeric_literal
71
import os import shutil import tempfile import pytest from scripttest import TestFileEnvironment as TFE import escpos TEST_DIR = tempfile.mkdtemp() + "/cli-test" DEVFILE_NAME = "testfile" DEVFILE = os.path.join(TEST_DIR, DEVFILE_NAME) CONFIGFILE = "testconfig.yaml" CONFIG_YAML = f""" --- printer: type: file ...
2
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_cli.py
test_cli_help
assert
complex_expr
68
import os import shutil import tempfile import pytest from scripttest import TestFileEnvironment as TFE import escpos TEST_DIR = tempfile.mkdtemp() + "/cli-test" DEVFILE_NAME = "testfile" DEVFILE = os.path.join(TEST_DIR, DEVFILE_NAME) CONFIGFILE = "testconfig.yaml" CONFIG_YAML = f""" --- printer: type: file ...
result.stdout
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_cli.py
test_cli_text_invalid_args
assert
complex_expr
72
import os import shutil import tempfile import pytest from scripttest import TestFileEnvironment as TFE import escpos TEST_DIR = tempfile.mkdtemp() + "/cli-test" DEVFILE_NAME = "testfile" DEVFILE = os.path.join(TEST_DIR, DEVFILE_NAME) CONFIGFILE = "testconfig.yaml" CONFIG_YAML = f""" --- printer: type: file ...
result.stderr
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_cli.py
test_cli_version
assert
func_call
68
import os import shutil import tempfile import pytest from scripttest import TestFileEnvironment as TFE import escpos TEST_DIR = tempfile.mkdtemp() + "/cli-test" DEVFILE_NAME = "testfile" DEVFILE = os.path.join(TEST_DIR, DEVFILE_NAME) CONFIGFILE = "testconfig.yaml" CONFIG_YAML = f""" --- printer: type: file ...
result.stdout.strip()
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_cli.py
test_cli_text
assert
func_call
78
import os import shutil import tempfile import pytest from scripttest import TestFileEnvironment as TFE import escpos TEST_DIR = tempfile.mkdtemp() + "/cli-test" DEVFILE_NAME = "testfile" DEVFILE = os.path.join(TEST_DIR, DEVFILE_NAME) CONFIGFILE = "testconfig.yaml" CONFIG_YAML = f""" --- printer: type: file ...
result.files_updated.keys()
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_cli.py
test_cli_text
assert
string_literal
79
import os import shutil import tempfile import pytest from scripttest import TestFileEnvironment as TFE import escpos TEST_DIR = tempfile.mkdtemp() + "/cli-test" DEVFILE_NAME = "testfile" DEVFILE = os.path.join(TEST_DIR, DEVFILE_NAME) CONFIGFILE = "testconfig.yaml" CONFIG_YAML = f""" --- printer: type: file ...
"\x1bt\x00" + test_text + "\n"
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_config.py
simple_printer_test
assert
string_literal
22
import pathlib import appdirs import pytest import escpos.exceptions def generate_dummy_config(path, content=None): """Generate a dummy config in path""" dummy_config_content = content if not content: dummy_config_content = "printer:\n type: Dummy\n" path.write_text(dummy_config_content) ...
b"1234"
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_config.py
generate_dummy_config
assert
variable
15
import pathlib import appdirs import pytest import escpos.exceptions def generate_dummy_config(path, content=None): """Generate a dummy config in path""" dummy_config_content = content if not content: dummy_config_content = "printer:\n type: Dummy\n" path.write_text(dummy_config_content) ...
dummy_config_content
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_config.py
test_config_load_with_invalid_config_yaml
pytest.raises
complex_expr
34
import pathlib import appdirs import pytest import escpos.exceptions def generate_dummy_config(path, content=None): """Generate a dummy config in path""" dummy_config_content = content if not content: dummy_config_content = "printer:\n type: Dummy\n" path.write_text(dummy_config_content) ...
escpos.exceptions.ConfigSyntaxError)
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_config.py
test_config_load_with_missing_config
pytest.raises
complex_expr
30
import pathlib import appdirs import pytest import escpos.exceptions def generate_dummy_config(path, content=None): """Generate a dummy config in path""" dummy_config_content = content if not content: dummy_config_content = "printer:\n type: Dummy\n" path.write_text(dummy_config_content) ...
escpos.exceptions.ConfigNotFoundError)
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_barcode.py
test_lacks_support
assert
string_literal
22
import pytest import escpos.printer as printer from escpos.capabilities import BARCODE_B, Profile from escpos.exceptions import BarcodeCodeError, BarcodeTypeError @pytest.mark.parametrize( "bctype,supports_b", [ ("invalid", True), ("CODE128", False), ], ) def test_lacks_support(bctype, sup...
b""
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_barcode.py
test_barcode
assert
variable
22
import pytest import escpos.printer as printer from escpos.capabilities import BARCODE_B, Profile from escpos.exceptions import BarcodeCodeError, BarcodeTypeError @pytest.mark.parametrize( "bctype,data,expected", [ ( "EAN13", "4006381333931", b"\x1ba\x01\x1dh@\x1dw\...
expected
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_barcode.py
test_lacks_support
pytest.raises
variable
19
import pytest import escpos.printer as printer from escpos.capabilities import BARCODE_B, Profile from escpos.exceptions import BarcodeCodeError, BarcodeTypeError @pytest.mark.parametrize( "bctype,supports_b", [ ("invalid", True), ("CODE128", False), ], ) def test_lacks_support(bctype, sup...
BarcodeTypeError)
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_barcode.py
test_code_check
pytest.raises
variable
18
import pytest import escpos.printer as printer from escpos.capabilities import BARCODE_B, Profile from escpos.exceptions import BarcodeCodeError, BarcodeTypeError @pytest.mark.parametrize( "bctype,data", [ ("EAN13", "AA"), ("CODE128", "{D2354AA"), ], ) def test_code_check(bctype, data): ...
BarcodeCodeError)
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_buzzer.py
test_buzzer_function_with_default_params
assert
variable
12
import pytest import six from escpos import printer from escpos.constants import BUZZER def test_buzzer_function_with_default_params(): instance = printer.Dummy() instance.buzzer() expected = BUZZER + six.int2byte(2) + six.int2byte(4) assert instance.output ==
expected
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_buzzer.py
test_buzzer_fuction_with_outrange_values
pytest.raises
variable
23
import pytest import six from escpos import printer from escpos.constants import BUZZER @pytest.mark.parametrize( "times, duration, expected_message", [ [0, 0, "times must be between 1 and 9"], [-1, 0, "times must be between 1 and 9"], [10, 0, "times must be between 1 and 9"], ...
ValueError)
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_buzzer.py
test_buzzer_fuction_with_outrange_values
assert
variable
26
import pytest import six from escpos import printer from escpos.constants import BUZZER @pytest.mark.parametrize( "times, duration, expected_message", [ [0, 0, "times must be between 1 and 9"], [-1, 0, "times must be between 1 and 9"], [10, 0, "times must be between 1 and 9"], ...
expected_message
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_cashdraw.py
test_raise_CashDrawerError
pytest.raises
variable
10
import pytest import escpos.printer as printer from escpos.exceptions import CashDrawerError def test_raise_CashDrawerError(): """should raise an error if the sequence is invalid.""" instance = printer.Dummy() with pytest.raises(
CashDrawerError)
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_cut.py
test_cut_without_feed
assert
variable
12
import six import escpos.printer as printer from escpos.constants import GS def test_cut_without_feed(): """Test cut without feeding paper""" instance = printer.Dummy() instance.cut(feed=False) expected = GS + b"V" + six.int2byte(66) + b"\x00" assert instance.output ==
expected
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_dummy_clear.py
test_printer_dummy_clear
assert
string_literal
8
from escpos.printer import Dummy def test_printer_dummy_clear(): printer = Dummy() printer.text("Hello") printer.clear() assert printer.output ==
b""
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_image.py
test_width_too_large
pytest.raises
variable
19
import pytest from PIL import Image import escpos.printer as printer from escpos.exceptions import ImageWidthError def dummy_with_width(): instance = printer.Dummy() instance.profile.profile_data = {"media": {"width": {"pixels": 384}}} return instance def test_width_too_large(dummy_with_width): """ ...
ImageWidthError)
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_image.py
test_bit_image_black
assert
string_literal
14
import pytest from PIL import Image import escpos.printer as printer from escpos.exceptions import ImageWidthError def test_bit_image_black(): """ Test printing solid black bit image (raster) """ instance = printer.Dummy() instance.image("test/resources/canvas_black.png", impl="bitImageRaster") ...
b"\x1dv0\x00\x01\x00\x01\x00\x80"
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_image.py
test_bit_image_white
assert
string_literal
14
import pytest from PIL import Image import escpos.printer as printer from escpos.exceptions import ImageWidthError def test_bit_image_white(): """ Test printing solid white bit image (raster) """ instance = printer.Dummy() instance.image("test/resources/canvas_white.png", impl="bitImageRaster") ...
b"\x1dv0\x00\x01\x00\x01\x00\x00"
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_image.py
test_bit_image_both
assert
string_literal
14
import pytest from PIL import Image import escpos.printer as printer from escpos.exceptions import ImageWidthError def test_bit_image_both(): """ Test printing black/white bit image (raster) """ instance = printer.Dummy() instance.image("test/resources/black_white.png", impl="bitImageRaster") ...
b"\x1dv0\x00\x01\x00\x02\x00\xc0\x00"
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_image.py
test_bit_image_colfmt_black
assert
string_literal
14
import pytest from PIL import Image import escpos.printer as printer from escpos.exceptions import ImageWidthError def test_bit_image_colfmt_black(): """ Test printing solid black bit image (column format) """ instance = printer.Dummy() instance.image("test/resources/canvas_black.png", impl="bitIm...
b"\x1b3\x10\x1b*!\x01\x00\x80\x00\x00\x0a\x1b2"
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_image.py
test_bit_image_colfmt_white
assert
string_literal
14
import pytest from PIL import Image import escpos.printer as printer from escpos.exceptions import ImageWidthError def test_bit_image_colfmt_white(): """ Test printing solid white bit image (column format) """ instance = printer.Dummy() instance.image("test/resources/canvas_white.png", impl="bitIm...
b"\x1b3\x10\x1b*!\x01\x00\x00\x00\x00\x0a\x1b2"
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_image.py
test_bit_image_colfmt_both
assert
string_literal
14
import pytest from PIL import Image import escpos.printer as printer from escpos.exceptions import ImageWidthError def test_bit_image_colfmt_both(): """ Test printing black/white bit image (column format) """ instance = printer.Dummy() instance.image("test/resources/black_white.png", impl="bitImag...
b"\x1b3\x10\x1b*!\x02\x00\x80\x00\x00\x80\x00\x00\x0a\x1b2"
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_image.py
test_large_graphics
assert
string_literal
16
import pytest from PIL import Image import escpos.printer as printer from escpos.exceptions import ImageWidthError def test_large_graphics(): """ Test whether 'large' graphics that induce a fragmentation are handled correctly. """ instance = printer.Dummy() instance.image( "test/resources/...
b"\x1dv0\x00\x01\x00\x01\x00\xc0\x1dv0\x00\x01\x00\x01\x00\x00"
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_image.py
test_graphics_black
assert
string_literal
14
import pytest from PIL import Image import escpos.printer as printer from escpos.exceptions import ImageWidthError def test_graphics_black(): """ Test printing solid black graphics """ instance = printer.Dummy() instance.image("test/resources/canvas_black.png", impl="graphics") assert
b"\x1d(L\x0b\x000p0\x01\x011\x01\x00\x01\x00\x80\x1d(L\x02\x0002"
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_image.py
test_graphics_white
assert
string_literal
14
import pytest from PIL import Image import escpos.printer as printer from escpos.exceptions import ImageWidthError def test_graphics_white(): """ Test printing solid white graphics """ instance = printer.Dummy() instance.image("test/resources/canvas_white.png", impl="graphics") assert
b"\x1d(L\x0b\x000p0\x01\x011\x01\x00\x01\x00\x00\x1d(L\x02\x0002"
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_image.py
test_graphics_both
assert
string_literal
14
import pytest from PIL import Image import escpos.printer as printer from escpos.exceptions import ImageWidthError def test_graphics_both(): """ Test printing black/white graphics """ instance = printer.Dummy() instance.image("test/resources/black_white.png", impl="graphics") assert
b"\x1d(L\x0c\x000p0\x01\x011\x02\x00\x02\x00\xc0\x00\x1d(L\x02\x0002"
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_linedisplay.py
test_function_linedisplay_clear
assert
string_literal
8
import escpos.printer as printer def test_function_linedisplay_clear(): """test the linedisplay_clear function""" instance = printer.Dummy() instance.linedisplay_clear() assert instance.output ==
b"\x1B\x40"
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_linedisplay.py
test_function_linedisplay_select_on
assert
string_literal
8
import escpos.printer as printer def test_function_linedisplay_select_on(): """test the linedisplay_select function (activate)""" instance = printer.Dummy() instance.linedisplay_select(select_display=True) assert instance.output ==
b"\x1B\x3D\x02"
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_linedisplay.py
test_function_linedisplay_select_off
assert
string_literal
8
import escpos.printer as printer def test_function_linedisplay_select_off(): """test the linedisplay_select function (deactivate)""" instance = printer.Dummy() instance.linedisplay_select(select_display=False) assert instance.output ==
b"\x1B\x3D\x01"
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_panel_button.py
test_function_panel_button_on
assert
string_literal
8
import escpos.printer as printer def test_function_panel_button_on(): """test the panel button function (enabling) by comparing output""" instance = printer.Dummy() instance.panel_buttons() assert instance.output ==
b"\x1B\x63\x35\x00"
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_panel_button.py
test_function_panel_button_off
assert
string_literal
8
import escpos.printer as printer def test_function_panel_button_off(): """test the panel button function (disabling) by comparing output""" instance = printer.Dummy() instance.panel_buttons(False) assert instance.output ==
b"\x1B\x63\x35\x01"
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_qr_native.py
test_empty
assert
string_literal
11
import pytest import escpos.printer as printer from escpos.constants import QR_ECLEVEL_H, QR_MODEL_1 def test_empty(): """Test QR printing blank code""" instance = printer.Dummy() instance.qr("", native=True) assert instance.output ==
b""
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_qr_native.py
test_defaults
assert
variable
15
import pytest import escpos.printer as printer from escpos.constants import QR_ECLEVEL_H, QR_MODEL_1 def test_defaults(): """Test QR code with defaults""" instance = printer.Dummy() instance.qr("1234", native=True) expected = ( b"\x1d(k\x04\x001A2\x00\x1d(k\x03\x001C\x03\x1d(k\x03\x001E0\x1d" ...
expected
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_qr_native.py
test_invalid_ec
pytest.raises
variable
10
import pytest import escpos.printer as printer from escpos.constants import QR_ECLEVEL_H, QR_MODEL_1 def test_invalid_ec(): """Test invalid QR error correction""" instance = printer.Dummy() with pytest.raises(
ValueError)
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_qr_native.py
test_center_not_implementer
pytest.raises
variable
11
import pytest import escpos.printer as printer from escpos.constants import QR_ECLEVEL_H, QR_MODEL_1 def instance(): return printer.Dummy() def test_center_not_implementer(instance): with pytest.raises(
NotImplementedError)
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_qr_non-native.py
test_parameter_image_arguments_passed_to_image_function
assert
bool_literal
27
import warnings import mock import pytest from PIL import Image from escpos.printer import Dummy @mock.patch("escpos.printer.Dummy.image", spec=Dummy) def test_parameter_image_arguments_passed_to_image_function(img_function): """Test the parameter passed to non-native qr printing.""" d = Dummy() d.qr( ...
False
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_qr_non-native.py
test_parameter_image_arguments_passed_to_image_function
assert
variable
24
import warnings import mock import pytest from PIL import Image from escpos.printer import Dummy @mock.patch("escpos.printer.Dummy.image", spec=Dummy) def test_parameter_image_arguments_passed_to_image_function(img_function): """Test the parameter passed to non-native qr printing.""" d = Dummy() d.qr( ...
kwargs
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_qr_non-native.py
test_image
assert
variable
29
import warnings import mock import pytest from PIL import Image from escpos.printer import Dummy def test_image(): """Test QR as image""" instance = Dummy() image_arguments = { "high_density_vertical": True, "high_density_horizontal": True, "impl": "bitImageRaster", "fragm...
expected
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_qr_non-native.py
test_parameter_image_arguments_passed_to_image_function
assert
string_literal
25
import warnings import mock import pytest from PIL import Image from escpos.printer import Dummy @mock.patch("escpos.printer.Dummy.image", spec=Dummy) def test_parameter_image_arguments_passed_to_image_function(img_function): """Test the parameter passed to non-native qr printing.""" d = Dummy() d.qr( ...
"bitImageColumn"
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_qr_non-native.py
test_deprecated_arguments
assert
func_call
24
import warnings import mock import pytest from PIL import Image from escpos.printer import Dummy def instance(): return Dummy() def test_deprecated_arguments(instance): """Test deprecation warning.""" with warnings.catch_warnings(record=True) as w: # cause all warnings to always be triggered ...
str(w[-1].message)
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_set.py
test_default_values
assert
string_literal
14
import pytest import six import escpos.printer as printer from escpos.constants import SET_FONT, TXT_NORMAL, TXT_SIZE, TXT_STYLE from escpos.exceptions import SetVariableError def test_default_values(): """Default test""" instance = printer.Dummy() instance.set() assert instance.output ==
b""
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_set.py
test_set_size_custom_invalid_input
pytest.raises
variable
13
import pytest import six import escpos.printer as printer from escpos.constants import SET_FONT, TXT_NORMAL, TXT_SIZE, TXT_STYLE from escpos.exceptions import SetVariableError @pytest.mark.parametrize("width", [None, 0, 9, 10, 4444]) @pytest.mark.parametrize("height", [None, 0, 9, 10, 4444]) def test_set_size_custom_...
SetVariableError)
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_set.py
test_default_values_with_default
assert
string_literal
26
import pytest import six import escpos.printer as printer from escpos.constants import SET_FONT, TXT_NORMAL, TXT_SIZE, TXT_STYLE from escpos.exceptions import SetVariableError def test_default_values_with_default(): """Default test, please copy and paste this block to test set method calls""" instance = print...
b"".join(expected_sequence)
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_softbarcode.py
test_soft_barcode_ean8_invalid
pytest.raises
complex_expr
12
import barcode.errors import pytest import escpos.printer as printer def instance(): return printer.Dummy() def test_soft_barcode_ean8_invalid(instance): """test with an invalid barcode""" with pytest.raises(
barcode.errors.BarcodeError)
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_text.py
test_textln_empty
assert
string_literal
15
import hypothesis.strategies as st import mock import pytest from hypothesis import assume, given from escpos.printer import Dummy def get_printer(): return Dummy(magic_encode_args={"disabled": True, "encoding": "CP437"}) def test_textln_empty(): printer = get_printer() printer.textln() assert print...
b"\n"
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_text.py
test_text
assert_*
variable
18
import hypothesis.strategies as st import mock import pytest from hypothesis import assume, given from escpos.printer import Dummy def get_printer(): return Dummy(magic_encode_args={"disabled": True, "encoding": "CP437"}) @given(text=st.text()) def test_text(text): """Test that text() calls the MagicEncode o...
text)
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_text.py
test_multiple_ln
assert
string_literal
15
import hypothesis.strategies as st import mock import pytest from hypothesis import assume, given from escpos.printer import Dummy def get_printer(): return Dummy(magic_encode_args={"disabled": True, "encoding": "CP437"}) def test_multiple_ln(): printer = get_printer() printer.ln(3) assert printer.o...
b"\n\n\n"
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_text.py
test_textln
assert
string_literal
15
import hypothesis.strategies as st import mock import pytest from hypothesis import assume, given from escpos.printer import Dummy def get_printer(): return Dummy(magic_encode_args={"disabled": True, "encoding": "CP437"}) def test_textln(): printer = get_printer() printer.textln("hello, world") asse...
b"hello, world\n"
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_function_text.py
test_block_text
assert
string_literal
17
import hypothesis.strategies as st import mock import pytest from hypothesis import assume, given from escpos.printer import Dummy def get_printer(): return Dummy(magic_encode_args={"disabled": True, "encoding": "CP437"}) def test_block_text(): printer = get_printer() printer.block_text( "All the...
b"All the presidents men were eating falafel\nfor breakfast."
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_functions.py
test_line_spacing_rest
assert
string_literal
9
import pytest from escpos.printer import Dummy def test_line_spacing_rest(): printer = Dummy() printer.line_spacing() assert printer.output ==
b"\x1b2"
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_functions.py
test_line_spacing_code_gen
assert
string_literal
9
import pytest from escpos.printer import Dummy def test_line_spacing_code_gen(): printer = Dummy() printer.line_spacing(10) assert printer.output ==
b"\x1b3\n"
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_functions.py
test_line_spacing_error_handling
pytest.raises
variable
8
import pytest from escpos.printer import Dummy def test_line_spacing_error_handling(): printer = Dummy() with pytest.raises(
ValueError)
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_image.py
test_split
assert
string_literal
14
from escpos.image import EscposImage def test_split(): """ test whether the split-function works as expected """ im = EscposImage("test/resources/black_white.png") (upper_part, lower_part) = im.split(1) upper_part = EscposImage(upper_part) lower_part = EscposImage(lower_part) assert upp...
b"\xc0"
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_image.py
test_split
assert
string_literal
15
from escpos.image import EscposImage def test_split(): """ test whether the split-function works as expected """ im = EscposImage("test/resources/black_white.png") (upper_part, lower_part) = im.split(1) upper_part = EscposImage(upper_part) lower_part = EscposImage(lower_part) assert upp...
b"\x00"
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_image.py
_load_and_check_img
assert
variable
15
from escpos.image import EscposImage def _load_and_check_img( filename, width_expected, height_expected, raster_format_expected, column_format_expected, ): """ Load an image, and test whether raster & column formatted output, sizes, etc match expectations. """ im = EscposImage("test...
width_expected
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_image.py
_load_and_check_img
assert
variable
16
from escpos.image import EscposImage def _load_and_check_img( filename, width_expected, height_expected, raster_format_expected, column_format_expected, ): """ Load an image, and test whether raster & column formatted output, sizes, etc match expectations. """ im = EscposImage("test...
height_expected
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_image.py
test_split
assert
complex_expr
12
from escpos.image import EscposImage def test_split(): """ test whether the split-function works as expected """ im = EscposImage("test/resources/black_white.png") (upper_part, lower_part) = im.split(1) upper_part = EscposImage(upper_part) lower_part = EscposImage(lower_part) assert up...
lower_part.width
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_image.py
test_split
assert
complex_expr
13
from escpos.image import EscposImage def test_split(): """ test whether the split-function works as expected """ im = EscposImage("test/resources/black_white.png") (upper_part, lower_part) = im.split(1) upper_part = EscposImage(upper_part) lower_part = EscposImage(lower_part) assert upp...
lower_part.height
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_image.py
_load_and_check_img
assert
variable
17
from escpos.image import EscposImage def _load_and_check_img( filename, width_expected, height_expected, raster_format_expected, column_format_expected, ): """ Load an image, and test whether raster & column formatted output, sizes, etc match expectations. """ im = EscposImage("test...
raster_format_expected
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_image.py
_load_and_check_img
assert
complex_expr
20
from escpos.image import EscposImage def _load_and_check_img( filename, width_expected, height_expected, raster_format_expected, column_format_expected, ): """ Load an image, and test whether raster & column formatted output, sizes, etc match expectations. """ im = EscposImage("test...
column_format_expected[i]
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_load_module_missing_capability.py
test_instantiation
pytest.raises
variable
19
import os import tempfile import pytest def test_instantiation(): """test the instantiation of a escpos-printer class""" # inject an environment variable that points to an empty capabilities file os.environ["ESCPOS_CAPABILITIES_FILE"] = tempfile.NamedTemporaryFile().name import escpos.printer as prin...
BarcodeTypeError)
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_magicencode.py
test_disabled_requires_encoding
pytest.raises
variable
18
import hypothesis.strategies as st import pytest from hypothesis import example, given from escpos.exceptions import CharCodeError, Error from escpos.katakana import encode_katakana from escpos.magicencode import Encoder, MagicEncode class TestInit: def test_disabled_requires_encoding(self, driver): ...
Error)
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_magicencode.py
test_find_suitable_encoding
assert
string_literal
14
import hypothesis.strategies as st import pytest from hypothesis import example, given from escpos.exceptions import CharCodeError, Error from escpos.katakana import encode_katakana from escpos.magicencode import Encoder, MagicEncode class TestEncoder: def test_find_suitable_encoding(self): assert not En...
"CP858"
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_magicencode.py
test_find_suitable_encoding_unnecessary_codepage_swap
assert
string_literal
17
import hypothesis.strategies as st import pytest from hypothesis import example, given from escpos.exceptions import CharCodeError, Error from escpos.katakana import encode_katakana from escpos.magicencode import Encoder, MagicEncode class TestEncoder: def test_find_suitable_encoding_unnecessary_codepage_swap(se...
"CP857"
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_magicencode.py
test_get_encoding
pytest.raises
variable
13
import hypothesis.strategies as st import pytest from hypothesis import example, given from escpos.exceptions import CharCodeError, Error from escpos.katakana import encode_katakana from escpos.magicencode import Encoder, MagicEncode class TestEncoder: def test_get_encoding(self): with pytest.raises(
ValueError)
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_magicencode.py
test
assert
string_literal
14
import hypothesis.strategies as st import pytest from hypothesis import example, given from escpos.exceptions import CharCodeError, Error from escpos.katakana import encode_katakana from escpos.magicencode import Encoder, MagicEncode class TestForceEncoding: def test(self, driver): encode = Ma...
b"\x1bt\x00"
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_magicencode.py
test_write_disabled
assert
string_literal
15
import hypothesis.strategies as st import pytest from hypothesis import example, given from escpos.exceptions import CharCodeError, Error from escpos.katakana import encode_katakana from escpos.magicencode import Encoder, MagicEncode class TestWrite: def test_write_disabled(self, driver): enc...
b"? ist teuro."
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_magicencode.py
test_write_no_codepage
assert
string_literal
20
import hypothesis.strategies as st import pytest from hypothesis import example, given from escpos.exceptions import CharCodeError, Error from escpos.katakana import encode_katakana from escpos.magicencode import Encoder, MagicEncode class TestWrite: def test_write_no_codepage(self, driver): ...
b"_ ist teuro."
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_magicencode.py
test_no_change
assert
string_literal
15
import hypothesis.strategies as st import pytest from hypothesis import example, given from escpos.exceptions import CharCodeError, Error from escpos.katakana import encode_katakana from escpos.magicencode import Encoder, MagicEncode class TestWriteWithEncoding: def test_no_change(self, driver): ...
b"\xd5 ist teuro."
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_magicencode.py
test_result
assert
string_literal
13
import hypothesis.strategies as st import pytest from hypothesis import example, given from escpos.exceptions import CharCodeError, Error from escpos.katakana import encode_katakana from escpos.magicencode import Encoder, MagicEncode class TestKatakana: def test_result(self): assert encode_katakana("カタカ...
b"\xb6\xc0\xb6\xc5"
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_magicencode.py
test_result
assert
string_literal
14
import hypothesis.strategies as st import pytest from hypothesis import example, given from escpos.exceptions import CharCodeError, Error from escpos.katakana import encode_katakana from escpos.magicencode import Encoder, MagicEncode class TestKatakana: def test_result(self): assert encode_katakana("カタカナ...
b"\xb1\xb2\xb3\xb4\xb5"
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_magicencode.py
test
assert
string_literal
17
import hypothesis.strategies as st import pytest from hypothesis import example, given from escpos.exceptions import CharCodeError, Error from escpos.katakana import encode_katakana from escpos.magicencode import Encoder, MagicEncode class TestForceEncoding: def test(self, driver): encode = Ma...
b"\x1bt\x00? ist teuro."
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_magicencode.py
test_init_from_none
assert
string_literal
14
import hypothesis.strategies as st import pytest from hypothesis import example, given from escpos.exceptions import CharCodeError, Error from escpos.katakana import encode_katakana from escpos.magicencode import Encoder, MagicEncode class TestWriteWithEncoding: def test_init_from_none(self, driver): ...
b"\x1bt\x13\xd5 ist teuro."
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_magicencode.py
test_write
assert
string_literal
14
import hypothesis.strategies as st import pytest from hypothesis import example, given from escpos.exceptions import CharCodeError, Error from escpos.katakana import encode_katakana from escpos.magicencode import Encoder, MagicEncode class TestWrite: def test_write(self, driver): encode = Magi...
b"\x1bt\x0f\xa4 ist teuro."
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor
python-escpos/python-escpos
815f247df19055743515e19c40a03ab46ac0c72c
27
train
train
test/test_printers/test_printer_cups.py
test_printers_no_device
assert
collection
18
import logging import sys import pytest pytestmark = pytest.mark.skipif( sys.platform == "win32", reason="skipping non Windows platform specific tests" ) def test_printers_no_device(cupsprinter): """ GIVEN a cups printer object WHEN device is None THEN check the return value is {} """ cup...
{}
815f247df19055743515e19c40a03ab46ac0c72c
27
v2_extractor_at_anchor