@@ -61,8 +61,9 @@ def test_find_candidates(self, command):
6161 def test_make_nsdict (self , command ):
6262 candidate = self ._make_candidate (command )
6363 nsdict = self .loader ._make_nsdict (candidate )
64- assert nsdict ['SECTION' ] == self .expected_section [command ]
65- assert isinstance (nsdict ['CLI' ], click .Command )
64+ plugin = nsdict ['PLUGIN' ]
65+ assert plugin .section == self .expected_section [command ]
66+ assert isinstance (plugin .command , click .Command )
6667
6768 @pytest .mark .parametrize ('command' , ['pathsampling' , 'contents' ])
6869 def test_call (self , command ):
@@ -82,7 +83,7 @@ def setup(self):
8283 # use our own commands dir as a file-based plugin
8384 cmds_init = pathlib .Path (paths_cli .commands .__file__ ).resolve ()
8485 self .commands_dir = cmds_init .parent
85- self .loader = FilePluginLoader (self .commands_dir )
86+ self .loader = FilePluginLoader (self .commands_dir , OPSCommandPlugin )
8687 self .plugin_type = 'file'
8788
8889 def _make_candidate (self , command ):
@@ -99,15 +100,15 @@ class TestNamespacePluginLoader(PluginLoaderTest):
99100 def setup (self ):
100101 super ().setup ()
101102 self .namespace = "paths_cli.commands"
102- self .loader = NamespacePluginLoader (self .namespace )
103+ self .loader = NamespacePluginLoader (self .namespace , OPSCommandPlugin )
103104 self .plugin_type = 'namespace'
104105
105106 def _make_candidate (self , command ):
106107 name = self .namespace + "." + command
107108 return importlib .import_module (name )
108109
109110 def test_get_command_name (self ):
110- loader = NamespacePluginLoader ('foo.bar' )
111+ loader = NamespacePluginLoader ('foo.bar' , OPSCommandPlugin )
111112 candidate = MagicMock (__name__ = "foo.bar.baz_qux" )
112113 expected = "baz-qux"
113114 assert loader ._get_command_name (candidate ) == expected
0 commit comments