Ejemplo n.º 1
0
 def test_build_plugin(self):
     tmp = build_plugin("%s/data/test_build_plugin" % TEST_DIRECTORY,
                        plugins_base_dir=self.base_path)
     self.assertTrue(tmp is not None)
     b = os.path.basename(tmp)
     d = os.path.dirname(tmp)
     self.assertEquals(d, os.getcwd())
     self.assertEquals(b, "bar-1-1.metwork.%s.plugin" %
                       os.environ['MODULE_LOWERCASE'])
Ejemplo n.º 2
0
 def test_duplicate_install_plugin(self):
     tmp = build_plugin("%s/data/test_build_plugin" % TEST_DIRECTORY,
                        plugins_base_dir=self.base_path)
     self.assertTrue(tmp is not None)
     install_plugin(tmp, plugins_base_dir=self.base_path)
     try:
         install_plugin(tmp, plugins_base_dir=self.base_path)
         raise Exception("MFUtilPluginAlreadyInstalled not raised")
     except MFUtilPluginAlreadyInstalled:
         pass
Ejemplo n.º 3
0
 def test_install_plugin(self):
     tmp = build_plugin("%s/data/test_build_plugin" % TEST_DIRECTORY,
                        plugins_base_dir=self.base_path)
     self.assertTrue(tmp is not None)
     install_plugin(tmp, plugins_base_dir=self.base_path)
     tmp = get_plugin_info("bar", mode="name",
                           plugins_base_dir=self.base_path)
     self.assertTrue(tmp is not None)
     self.assertEquals(tmp['metadatas']['name'], 'bar')
     uninstall_plugin("bar", plugins_base_dir=self.base_path)
Ejemplo n.º 4
0
def main():
    arg_parser = argparse.ArgumentParser(description=DESCRIPTION)
    arg_parser.add_argument("--plugin-path", default=".",
                            help="plugin directory path")
    arg_parser.add_argument("--show-plugin-path", action="store_true",
                            default=False,
                            help="show the generated plugin path")
    args = arg_parser.parse_args()
    echo_running("- Building plugin...")
    try:
        path = build_plugin(args.plugin_path)
    except MFUtilPluginCantBuild as e:
        echo_nok()
        print(e)
        sys.exit(1)
    echo_ok()
    if args.show_plugin_path:
        echo_bold("plugins is ready at %s" % path)
Ejemplo n.º 5
0
def main():
    arg_parser = argparse.ArgumentParser(description=DESCRIPTION)
    arg_parser.add_argument("--plugin-path",
                            default=".",
                            help="plugin directory path")
    arg_parser.add_argument("--show-plugin-path",
                            action="store_true",
                            default=False,
                            help="show the generated plugin path")
    args = arg_parser.parse_args()
    echo_running("- Building plugin...")
    try:
        path = build_plugin(args.plugin_path)
    except MFUtilPluginCantBuild as e:
        echo_nok()
        print(e)
        sys.exit(1)
    echo_ok()
    if args.show_plugin_path:
        echo_bold("plugins is ready at %s" % path)