summaryrefslogtreecommitdiffstats
path: root/library/python/windows/ut
diff options
context:
space:
mode:
authorexprmntr <[email protected]>2022-02-10 16:46:50 +0300
committerDaniil Cherednik <[email protected]>2022-02-10 16:46:50 +0300
commita6396ea4e82c2605dcf9a11ebc4c289d0b1c734c (patch)
tree49e222ea1c5804306084bb3ae065bb702625360f /library/python/windows/ut
parent078ddb2fb76387cae14e8c3ceb5a896009a5a539 (diff)
Restoring authorship annotation for exprmntr <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'library/python/windows/ut')
-rw-r--r--library/python/windows/ut/test_windows.py30
-rw-r--r--library/python/windows/ut/ya.make18
2 files changed, 24 insertions, 24 deletions
diff --git a/library/python/windows/ut/test_windows.py b/library/python/windows/ut/test_windows.py
index e255d0560e0..bef3ec2dc58 100644
--- a/library/python/windows/ut/test_windows.py
+++ b/library/python/windows/ut/test_windows.py
@@ -4,16 +4,16 @@ import errno
import os
import pytest
-import library.python.strings
-import library.python.windows
+import library.python.strings
+import library.python.windows
def gen_error_access_denied():
- if library.python.windows.on_win():
+ if library.python.windows.on_win():
err = WindowsError()
err.errno = errno.EACCES
err.strerror = ''
- err.winerror = library.python.windows.ERRORS['ACCESS_DENIED']
+ err.winerror = library.python.windows.ERRORS['ACCESS_DENIED']
else:
err = OSError()
err.errno = errno.EACCES
@@ -23,7 +23,7 @@ def gen_error_access_denied():
def test_errorfix_buggy():
- @library.python.windows.errorfix
+ @library.python.windows.errorfix
def erroneous_func():
gen_error_access_denied()
@@ -36,11 +36,11 @@ def test_errorfix_buggy():
def test_errorfix_explicit():
- @library.python.windows.errorfix
+ @library.python.windows.errorfix
def erroneous_func():
- if library.python.windows.on_win():
+ if library.python.windows.on_win():
err = WindowsError()
- err.winerror = library.python.windows.ERRORS['ACCESS_DENIED']
+ err.winerror = library.python.windows.ERRORS['ACCESS_DENIED']
else:
err = OSError()
err.errno = errno.EACCES
@@ -56,27 +56,27 @@ def test_errorfix_explicit():
def test_errorfix_decoding_cp1251():
- @library.python.windows.errorfix
+ @library.python.windows.errorfix
def erroneous_func():
model_msg = u'Какое-то описание ошибки'
- if library.python.windows.on_win():
+ if library.python.windows.on_win():
err = WindowsError()
- err.strerror = library.python.strings.to_str(model_msg, 'cp1251')
+ err.strerror = library.python.strings.to_str(model_msg, 'cp1251')
else:
err = OSError()
- err.strerror = library.python.strings.to_str(model_msg)
+ err.strerror = library.python.strings.to_str(model_msg)
raise err
with pytest.raises(OSError) as errinfo:
erroneous_func()
error_msg = errinfo.value.strerror
if not isinstance(errinfo.value.strerror, unicode):
- error_msg = library.python.strings.to_unicode(error_msg)
+ error_msg = library.python.strings.to_unicode(error_msg)
assert error_msg == u'Какое-то описание ошибки'
def test_diehard():
- @library.python.windows.diehard(library.python.windows.ERRORS['ACCESS_DENIED'], tries=5)
+ @library.python.windows.diehard(library.python.windows.ERRORS['ACCESS_DENIED'], tries=5)
def erroneous_func(errors):
try:
gen_error_access_denied()
@@ -90,7 +90,7 @@ def test_diehard():
assert errinfo.value.errno == errno.EACCES
assert any(e.errno == errno.EACCES for e in raised_errors)
assert raised_errors and errinfo.value == raised_errors[-1]
- if library.python.windows.on_win():
+ if library.python.windows.on_win():
assert len(raised_errors) == 5
else:
assert len(raised_errors) == 1
diff --git a/library/python/windows/ut/ya.make b/library/python/windows/ut/ya.make
index 5045153b938..c39f1797b85 100644
--- a/library/python/windows/ut/ya.make
+++ b/library/python/windows/ut/ya.make
@@ -1,11 +1,11 @@
-OWNER(g:yatool)
-
+OWNER(g:yatool)
+
PY2TEST()
-
+
TEST_SRCS(test_windows.py)
-
-PEERDIR(
- library/python/windows
-)
-
-END()
+
+PEERDIR(
+ library/python/windows
+)
+
+END()