Skip to content

Commit e1357e8

Browse files
authored
Test registry decorator (#250)
* Test registry decorator * PR template * version bump * pointless test
1 parent 18ac2e0 commit e1357e8

File tree

5 files changed

+18
-7
lines changed

5 files changed

+18
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8-
## Unreleased
8+
## [2.2.1] - 2018-01-06
99

1010
### Fixed
1111

fs/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""Version, used in module and setup.py.
22
"""
3-
__version__ = "2.2.0"
3+
__version__ = "2.2.1"

fs/info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
class Info(object):
3232
"""Container for :ref:`info`.
3333
34-
Resource informations are returned by the following methods:
34+
Resource information is returned by the following methods:
3535
3636
* `~fs.base.FS.getinfo`
3737
* `~fs.base.FS.scandir`

pull_request_template.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# PyFilesystem Pull Request
2-
3-
Thank you for your pull request!
4-
51
## Type of changes
62

73
- [ ] Bug fix

tests/test_opener.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from fs.memoryfs import MemoryFS
1616
from fs.appfs import UserDataFS
1717
from fs.opener.parse import ParseResult
18+
from fs.opener.registry import Registry
1819

1920

2021
class TestParse(unittest.TestCase):
@@ -167,6 +168,20 @@ def open_fs(self, *args, **kwargs):
167168
"could not instantiate opener; some creation error", str(ctx.exception)
168169
)
169170

171+
def test_install(self):
172+
"""Test Registry.install works as a decorator."""
173+
registry = Registry()
174+
self.assertNotIn("foo", registry.protocols)
175+
176+
@registry.install
177+
class FooOpener(opener.Opener):
178+
protocols = ["foo"]
179+
180+
def open_fs(self, *args, **kwargs):
181+
pass
182+
183+
self.assertIn("foo", registry.protocols)
184+
170185

171186
class TestManageFS(unittest.TestCase):
172187
def test_manage_fs_url(self):

0 commit comments

Comments
 (0)