-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
54 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
class TestContainerFactory(object): | ||
|
||
def test_initial_components(self, container_factory): | ||
config = {} | ||
|
||
components = { | ||
'config': config, | ||
'foo': 'bar', | ||
'bar': 'baz', | ||
} | ||
|
||
container = container_factory.create(**components) | ||
|
||
assert container('config') == config | ||
assert container('foo') == 'bar' | ||
assert container('bar') == 'baz' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
class TestPuglinsProviderAll(object): | ||
|
||
def test_returns_list(self, component_plugins_provider, component_plugin): | ||
result = component_plugins_provider.all() | ||
|
||
assert list(result) == [ | ||
(component_plugin.name, component_plugin.plugin), | ||
] | ||
|
||
|
||
class TestPuglinsProviderFilter(object): | ||
|
||
def test_not_filtered(self, component_plugins_provider, component_plugin): | ||
filtered = component_plugin.name + '123' | ||
result = component_plugins_provider.filter(filtered) | ||
|
||
assert list(result) == [] | ||
|
||
def test_filtered(self, component_plugins_provider, component_plugin): | ||
filtered = component_plugin.name | ||
result = component_plugins_provider.filter(filtered) | ||
|
||
assert list(result) == [ | ||
(component_plugin.name, component_plugin.plugin), | ||
] |