def setUp(self): self.group = Group.objects.create(slug="mygroup") self.project = self.group.projects.create( slug="myproject", project_settings="PLUGINS_TRADEFED_EXTRACT_AGGREGATED: True") self.build = self.project.builds.create(version="tradefed-build") self.env = self.project.environments.create(slug="myenv") self.testrun = self.build.test_runs.create(environment=self.env) self.backend = Backend.objects.create( url="http://lava.server/api/v0.2/", name="tradefed-backend", implementation_type="lava") self.testjob = self.build.test_jobs.create(definition=definition, target=self.project, backend=self.backend, job_id="123", testrun=self.testrun) self.tradefed = get_plugin_instance('tradefed')
def get_implementation(self): return get_plugin_instance(self.implementation)
def test_nonexisting(self): with self.assertRaises(PluginNotFound): get_plugin_instance('nonexisting')
def test_example(self): plugin = get_plugin_instance('example') self.assertIsInstance(plugin, Plugin)