Example #1
0
    def test_successSch(self):
        #initalize
        os.chdir(Utils.getProjRoot() + "data/testTemp")

        scheduler = Scheduler(intFile)
        schedule = scheduler.makeSchedule()

        #deinitilize
        os.chdir(Utils.getProjRoot() + "bin")

        result = set({schedule[1].toolName, schedule[0].toolName})
        expected = set({"Pylint", "SonarQube"})

        #assert
        assert expected == result
Example #2
0
def start():
    #setup/initalize
    Utils.setup()

    #process arugments
    processArgs()

    #temp src file will be set up by the time
    #process arguments returns

    #open internal file and turn it to json object
    with open(Utils.getProjRoot() + "data/internalFile.json", "r") as fp:
        intFile = json.load(fp)

    os.chdir(Utils.getProjRoot() + "data/temp")

    #make schedule
    scheduler = Scheduler(intFile=intFile)
    schedule = scheduler.makeSchedule()

    #runs engine
    engine = Engine(schedule=schedule)
    scanSuccess = engine.run()

    #generate report
    reportReader = ReportReader(schedule=schedule, intFile=intFile)
    reportGenerator = ReportGenerator(report=reportReader.parseReports(),
                                      name=name,
                                      verbose=verbose)
    reportGenerator.generateReports()

    #delete repo when processes and scans are done
    os.chdir(Utils.getProjRoot() + "bin")
    shutil.rmtree(Utils.getProjRoot() + "data/temp")

    return "NTI"