
import luna.test_case

class TestIntegration(luna.test_case.TestCase):
	pass #Not implemented yet.

import os.path #To get the plug-in directory.
import luna.plugins #To get the plug-ins to test with.
import luna.test_case

plugin_base = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", "..") #The main directory containing this plug-in (as well as all others we're hoping to find).
luna.plugins.add_plugin_location(plugin_base)
luna.plugins.discover()

class TestIntegration(luna.test_case.TestCase):
	"""
	Tests for each storage plug-in whether it properly implements the storage
	interface.
	"""

	@luna.test_case.parametrise(luna.plugins.plugins_by_type["storage"])
	def test_can_read(self, storage, **other_metadata):
		self.assertTrue(callable(storage["can_read"]), "The can_read function must be callable.")
Add simple test case to test plug-in discovery
Add simple test case to test plug-in discovery

This just tests if can_read is callable for now, but at least the plug-in discovery in tests works. It doesn't work beautifully, but we can work from here.

  
+ import os.path #To get the plug-in directory.
+ import luna.plugins #To get the plug-ins to test with.
  import luna.test_case
  
+ plugin_base = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", "..") #The main directory containing this plug-in (as well as all others we're hoping to find).
+ luna.plugins.add_plugin_location(plugin_base)
+ luna.plugins.discover()
+ 
  class TestIntegration(luna.test_case.TestCase):
- 	pass #Not implemented yet.
+ 	"""
+ 	Tests for each storage plug-in whether it properly implements the storage
+ 	interface.
+ 	"""
+ 
+ 	@luna.test_case.parametrise(luna.plugins.plugins_by_type["storage"])
+ 	def test_can_read(self, storage, **other_metadata):
+ 		self.assertTrue(callable(storage["can_read"]), "The can_read function must be callable.")
Add simple test case to test plug-in discovery
## Code Before:

import luna.test_case

class TestIntegration(luna.test_case.TestCase):
	pass #Not implemented yet.
## Instruction:
Add simple test case to test plug-in discovery
## Code After:

import os.path #To get the plug-in directory.
import luna.plugins #To get the plug-ins to test with.
import luna.test_case

plugin_base = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", "..") #The main directory containing this plug-in (as well as all others we're hoping to find).
luna.plugins.add_plugin_location(plugin_base)
luna.plugins.discover()

class TestIntegration(luna.test_case.TestCase):
	"""
	Tests for each storage plug-in whether it properly implements the storage
	interface.
	"""

	@luna.test_case.parametrise(luna.plugins.plugins_by_type["storage"])
	def test_can_read(self, storage, **other_metadata):
		self.assertTrue(callable(storage["can_read"]), "The can_read function must be callable.")