diff options
author | Mikhail Borisov <borisov.mikhail@gmail.com> | 2022-02-10 16:45:39 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:39 +0300 |
commit | a6a92afe03e02795227d2641b49819b687f088f8 (patch) | |
tree | f6984a1d27d5a7ec88a6fdd6e20cd5b7693b6ece /library/python/resource | |
parent | c6dc8b8bd530985bc4cce0137e9a5de32f1087cb (diff) | |
download | ydb-a6a92afe03e02795227d2641b49819b687f088f8.tar.gz |
Restoring authorship annotation for Mikhail Borisov <borisov.mikhail@gmail.com>. Commit 1 of 2.
Diffstat (limited to 'library/python/resource')
-rw-r--r-- | library/python/resource/__init__.py | 8 | ||||
-rw-r--r-- | library/python/resource/ut/lib/test_simple.py | 4 | ||||
-rw-r--r-- | library/python/resource/ut/lib/ya.make | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/library/python/resource/__init__.py b/library/python/resource/__init__.py index 26503ef7fce..627f4001f43 100644 --- a/library/python/resource/__init__.py +++ b/library/python/resource/__init__.py @@ -1,8 +1,8 @@ from __res import find as __find, count, key_by_index, resfs_files as __resfs_files from __res import resfs_read, resfs_resolve, resfs_src # noqa - + import six - + def iterkeys(prefix='', strip_prefix=False): decode = lambda s: s @@ -11,12 +11,12 @@ def iterkeys(prefix='', strip_prefix=False): decode = lambda s: s.decode('utf-8') for i in six.moves.range(count()): - key = key_by_index(i) + key = key_by_index(i) if key.startswith(prefix): if strip_prefix: key = key[len(prefix):] yield decode(key) - + def itervalues(prefix=b''): for key in iterkeys(prefix=prefix): diff --git a/library/python/resource/ut/lib/test_simple.py b/library/python/resource/ut/lib/test_simple.py index 52f006ff919..207307242cc 100644 --- a/library/python/resource/ut/lib/test_simple.py +++ b/library/python/resource/ut/lib/test_simple.py @@ -7,8 +7,8 @@ text = b'na gorshke sidel korol\n' def test_find(): assert rs.find('/qw.txt') == text - - + + def test_iter(): assert set(rs.iterkeys()).issuperset({'/qw.txt', '/prefix/1.txt', '/prefix/2.txt'}) assert set(rs.iterkeys(prefix='/prefix/')) == {'/prefix/1.txt', '/prefix/2.txt'} diff --git a/library/python/resource/ut/lib/ya.make b/library/python/resource/ut/lib/ya.make index 693e388878c..3930797334c 100644 --- a/library/python/resource/ut/lib/ya.make +++ b/library/python/resource/ut/lib/ya.make @@ -10,8 +10,8 @@ PEERDIR( RESOURCE( qw.txt /qw.txt - qw.txt /prefix/1.txt - qw.txt /prefix/2.txt + qw.txt /prefix/1.txt + qw.txt /prefix/2.txt ) END() |