parent
							
								
									748a075f1a
								
							
						
					
					
						commit
						bb3f176d41
					
				| @ -0,0 +1,12 @@ | |||||||
|  | from configspec import * | ||||||
|  | from shepherd import PluginInterface | ||||||
|  | 
 | ||||||
|  | interface = PluginInterface() | ||||||
|  | 
 | ||||||
|  | confspec = ConfigSpecification() | ||||||
|  | confspec.add_spec("spec1", StringSpec()) | ||||||
|  | 
 | ||||||
|  | confspec2 = ConfigSpecification() | ||||||
|  | confspec2.add_spec("spec2", StringSpec()) | ||||||
|  | 
 | ||||||
|  | interface.register_confspec(confspec2) | ||||||
| @ -0,0 +1,11 @@ | |||||||
|  | import pytest | ||||||
|  | from shepherd.agent import plugin | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | def test_simple_plugin_load(request): | ||||||
|  |     # If successful, will load as if it's a custom plugin | ||||||
|  |     interface = plugin.load_plugin("simpletestplugin", request.fspath.dirname) | ||||||
|  | 
 | ||||||
|  |     # Should prefer the confspec actually registered | ||||||
|  |     assert "spec2" in interface.confspec.spec_dict | ||||||
|  |     print(interface) | ||||||
					Loading…
					
					
				
		Reference in new issue