mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Fix xargs.partition tests: explicity set unicode chars
This commit is contained in:
parent
333ea75e45
commit
2560280d21
1 changed files with 3 additions and 3 deletions
|
|
@ -55,7 +55,7 @@ def test_partition_limits():
|
||||||
|
|
||||||
def test_partition_limit_win32(sys_win32_mock):
|
def test_partition_limit_win32(sys_win32_mock):
|
||||||
cmd = ('ninechars',)
|
cmd = ('ninechars',)
|
||||||
varargs = ('😑' * 10,)
|
varargs = (u'😑' * 10,)
|
||||||
with mock.patch('pre_commit.xargs.sys', sys_win32_mock):
|
with mock.patch('pre_commit.xargs.sys', sys_win32_mock):
|
||||||
ret = xargs.partition(cmd, varargs, _max_length=20)
|
ret = xargs.partition(cmd, varargs, _max_length=20)
|
||||||
|
|
||||||
|
|
@ -64,7 +64,7 @@ def test_partition_limit_win32(sys_win32_mock):
|
||||||
|
|
||||||
def test_partition_limit_linux(sys_linux_mock):
|
def test_partition_limit_linux(sys_linux_mock):
|
||||||
cmd = ('ninechars',)
|
cmd = ('ninechars',)
|
||||||
varargs = ('😑' * 5,)
|
varargs = (u'😑' * 5,)
|
||||||
with mock.patch('pre_commit.xargs.sys', sys_linux_mock):
|
with mock.patch('pre_commit.xargs.sys', sys_linux_mock):
|
||||||
ret = xargs.partition(cmd, varargs, _max_length=30)
|
ret = xargs.partition(cmd, varargs, _max_length=30)
|
||||||
|
|
||||||
|
|
@ -73,7 +73,7 @@ def test_partition_limit_linux(sys_linux_mock):
|
||||||
|
|
||||||
def test_argument_too_long_with_large_unicode(sys_linux_mock):
|
def test_argument_too_long_with_large_unicode(sys_linux_mock):
|
||||||
cmd = ('ninechars',)
|
cmd = ('ninechars',)
|
||||||
varargs = ('😑' * 10,) # 4 bytes * 10
|
varargs = (u'😑' * 10,) # 4 bytes * 10
|
||||||
with mock.patch('pre_commit.xargs.sys', sys_linux_mock):
|
with mock.patch('pre_commit.xargs.sys', sys_linux_mock):
|
||||||
with pytest.raises(xargs.ArgumentTooLongError):
|
with pytest.raises(xargs.ArgumentTooLongError):
|
||||||
xargs.partition(cmd, varargs, _max_length=20)
|
xargs.partition(cmd, varargs, _max_length=20)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue