def test_plugins(self): c1 = self.config.get_cluster_template('c1') plugs = c1.plugins assert len(plugs) == 3 # test that order is preserved p1, p2, p3 = plugs p1_name = p1.__name__ p1_class = utils.get_fq_class_name(p1) p2_name = p2.__name__ p2_class = utils.get_fq_class_name(p2) p3_name = p3.__name__ p3_class = utils.get_fq_class_name(p3) assert p1_name == 'p1' assert p1_class == 'starcluster.tests.mytestplugin.SetupClass' assert p1.my_arg == '23' assert p1.my_other_arg == 'skidoo' assert p2_name == 'p2' setup_class2 = 'starcluster.tests.mytestplugin.SetupClass2' assert p2_class == setup_class2 assert p2.my_arg == 'hello' assert p2.my_other_arg == 'world' assert p3_name == 'p3' setup_class3 = 'starcluster.tests.mytestplugin.SetupClass3' assert p3_class == setup_class3 assert p3.my_arg == 'bon' assert p3.my_other_arg == 'jour' assert p3.my_other_other_arg == 'monsignour'
def __new__(typ, *args, **kwargs): """ DO NOT OVERRIDE! This is an internal method used for plugin accounting. Do not override! If you *must* don't forget to call super! """ plugin = super(ClusterSetup, typ).__new__(typ) plugin_class_name = utils.get_fq_class_name(plugin) plugin.__plugin_metadata__ = (plugin_class_name, args, kwargs) return plugin