def testModuleCreation(self):
     ModuleSupport.createModule(TestCreateModule.modulePath)
     self.assertTrue(exists(TestCreateModule.modulePath), "Module not created")
     self.assertTrue(isdir(TestCreateModule.modulePath), "Did not create a folder")
     
     ModuleSupport.removeExistingModule(TestCreateModule.modulePath)
     self.assertFalse(exists(TestCreateModule.modulePath), "Module not deleted")
 def testLicenseExists(self):
     '''
     Test if the license file exists in the created module
     '''
     ModuleSupport.createModule(TestCreateModule.modulePath)
     self.assertTrue(exists(TestCreateModule.modulePath), "Module not created")
     licenseFileName = join(TestCreateModule.modulePath,"LGPLv3.txt")
     self.assertTrue(exists(licenseFileName), "License file not found")
     ModuleSupport.removeExistingModule(TestCreateModule.modulePath)
     self.assertFalse(exists(TestCreateModule.modulePath), "Module not deleted")
Exemplo n.º 3
0
        action='store',
        choices=['info', 'debug', 'warning', 'error', 'critical'],
        default='info',
        required=False)
    parser.add_argument(
        '-lcon',
        '--levelConsole',
        help=
        'Logging level: Set the level of the message for the console logger, default: Debug level',
        action='store',
        choices=['info', 'debug', 'warning', 'error', 'critical'],
        default='info',
        required=False)
    parser.add_argument('moduleName',
                        help='The name of the IAS module to create')
    args = parser.parse_args()
    stdoutLevel = args.levelStdOut
    consoleLevel = args.levelConsole
    logger = Log.initLogging(__file__, stdoutLevel, consoleLevel)
    if args.erase:
        try:
            ModuleSupport.removeExistingModule(args.moduleName)
        except Exception as e:
            logger.error("Error deleting the module: %s", str(e))
            exit(-1)
    try:
        ModuleSupport.createModule(args.moduleName)
    except Exception as e:
        logger.error("Error creating the module: %s", str(e))
        exit(-1)