Ejemplo n.º 1
0
 def setUp(self):
     logger.debug("DlgGramSettingsTestCase setUp()")
     self.unoObjs = testutil.unoObjsForCurrentDoc()
     USERVAR_PREFIX = "LTg_"  # for LinguisticTools Grammar variables
     self.userVars = UserVars(
         USERVAR_PREFIX, self.unoObjs.document, logger)
     self.dlg = DlgGramSettings(self.unoObjs)
Ejemplo n.º 2
0
 def setUpClass(cls):
     unoObjs = testutil.unoObjsForCurrentDoc()
     testutil.blankWriterDoc(unoObjs)
     logger.debug("----Manual Test BEGIN----------------------------------")
     msgr.unoObjs = unoObjs
     msgr.write(DASHES + "Running tests" + DASHES)
     msgr.endl()
Ejemplo n.º 3
0
 def setUp(self):
     unoObjs = testutil.unoObjsForCurrentDoc()
     fileconfig = fileitemlist.WordListFileItem(None)
     docReader = DocReader(fileconfig, unoObjs, -1)
     docReader.loadDoc(self.INFILE)
     self.unoObjs = docReader.doc
     testutil.stored.doc = self.unoObjs.document
     self.progressBar = ProgressBar(self.unoObjs, "TestSearch")
 def test5_targetFont(self):
     """Test target font and size, do not change font, changing without
     applying style, applying a paragraph style and changing its font.
     """
     Test5Data = collections.namedtuple(
         'Test5Data', ['fontType', 'type_ctrl', 'testChar'])
     dataSets = [
         Test5Data("Western", "optTargetFontWestern", "a"),
         # Tamil letter Ma
         Test5Data("Complex", "optTargetFontComplex", "\u0bae"),
         # a Chinese character
         Test5Data("Asian", "optTargetFontAsian", "\ua000")
     ]
     for dataSet in dataSets:
         if dataSet != dataSets[0]:
             # Get a fresh document.
             self.unoObjs = testutil.unoObjsForCurrentDoc()
             self.dlg = DlgDataConversion(self.unoObjs)
         for ctrlName in ("optTargetNoChange", "optTargetFontOnly",
                          "optTargetParaStyle"):
             self._test5_do_dataSet(dataSet, ctrlName)
def run_suite(suite, outputToFile):

    ## Make sure a writer document is open

    ctx = testutil.stored.getContext()
    unoObjs = util.UnoObjs(ctx, loadDocObjs=False)
    if len(unoObjs.getOpenDocs()) == 0:
        unoObjs.desktop.loadComponentFromURL("private:factory/swriter",
                                             "_blank", 0, ())

    ## Load and run the suite

    if outputToFile:
        run_suite_to_outfile(suite)
    else:
        unittest.TextTestRunner(verbosity=2).run(suite)

    unoObjs = testutil.unoObjsForCurrentDoc()
    oVC = unoObjs.viewcursor
    oVC.gotoEnd(False)
    oVC.getText().insertString(oVC, "Testing finished.\n", False)
    testutil.restoreMsgboxDisplay()
 def setUp(self):
     self.unoObjs = testutil.unoObjsForCurrentDoc()
     self.exnumRanges = []
     USERVAR_PREFIX = "LTg_"  # for Grammar
     self.userVars = UserVars(USERVAR_PREFIX, self.unoObjs.document, logger)
     self.styles = styles.GrammarStyles(self.unoObjs, self.userVars)
     self.styles.createStyles()
     self.baseConfig = lingex_structs.InterlinOutputSettings(None)
     self.baseConfig.makeOuterTable = True
     self.baseConfig.methodFrames = True
     self.baseConfig.methodTables = False
     self.baseConfig.showOrthoTextLine = True
     self.baseConfig.showText = True
     self.baseConfig.showOrthoMorphLine = True
     self.baseConfig.showMorphemeBreaks = True
     self.baseConfig.showPartOfSpeech = True
     self.baseConfig.insertNumbering = True
     self.baseConfig.separateMorphColumns = True
     self.baseConfig.POS_aboveGloss = False
     self.baseConfig.freeTransInQuotes = True
     self.baseConfig.startingOuterRowHeight = 2
     self.baseConfig.tableBottomMargin = 0.5
     self.baseConfig.numberingColumnWidth = 5
Ejemplo n.º 7
0
 def setUp(self):
     self.unoObjs = testutil.unoObjsForCurrentDoc()
     self.exnumRanges = []
     self.userVars = UserVars(Prefix.INTERLINEAR, self.unoObjs.document,
                              logger)
     self.styles = styles.InterlinStyles(self.unoObjs, self.userVars)
     self.config = lingex_structs.InterlinOutputSettings(None)
     self.config.makeOuterTable = True
     self.config.insertNumbering = False
     self.config.methodFrames = True
     self.config.startingOuterRowHeight = 2
     self.config.numberingColumnWidth = 5
     self.config.showOrthoTextLine = False
     self.config.showText = True
     self.config.showOrthoMorphLine = False
     self.config.showMorphemeBreaks = True
     self.config.showPartOfSpeech = True
     self.config.insertNumbering = True
     self.config.separateMorphColumns = True
     self.config.POS_aboveGloss = False
     self.config.tableBottomMargin = 0
     self.styles.parastyles.createInDoc("numP")
     self.styles.styleNames = {}
     self.styles.styleNames['numP'] = 'User Index 1'
Ejemplo n.º 8
0
 def setUp(self):
     self.unoObjs = testutil.unoObjsForCurrentDoc()
     self.srcdir = os.path.join(util.TESTDATA_FOLDER, "all_scope_types")
Ejemplo n.º 9
0
 def tearDownClass(cls):
     #unoObjs = util.UnoObjs(
     #    testutil.stored.getContext(), loadDocObjs=False)
     unoObjs = testutil.unoObjsForCurrentDoc()
     testutil.blankWriterDoc(unoObjs)
Ejemplo n.º 10
0
 def setUp(self):
     self.unoObjs = testutil.unoObjsForCurrentDoc()
     self.userVars = UserVars(Prefix.BULK_CONVERSION, self.unoObjs.document,
                              logger)
     self.msgbox = MessageBox(self.unoObjs)
 def setUp(self):
     self.unoObjs = testutil.unoObjsForCurrentDoc()
     USERVAR_PREFIX = "LTsp_"  # Spelling variables
     self.userVars = uservars.UserVars(USERVAR_PREFIX,
                                       self.unoObjs.document, logger)
     self.msgbox = MessageBox(self.unoObjs)
 def setUp(self):
     self.unoObjs = testutil.unoObjsForCurrentDoc()
     USERVAR_PREFIX = 'LTbc_'  # LinguisticTools Bulk Conversion vars
     self.userVars = UserVars(USERVAR_PREFIX, self.unoObjs.document, logger)
     self.msgbox = MessageBox(self.unoObjs)
Ejemplo n.º 13
0
 def setUp(self):
     self.unoObjs = testutil.unoObjsForCurrentDoc()
     USERVAR_PREFIX = "LTg_"  # Grammar
     self.userVars = UserVars(USERVAR_PREFIX, self.unoObjs.document, logger)
 def tearDownClass(cls):
     unoObjs = testutil.unoObjsForCurrentDoc()
     testutil.blankWriterDoc(unoObjs)
 def tearDown(self):
     unoObjs = testutil.unoObjsForCurrentDoc()
     testutil.blankWriterDoc(unoObjs)
 def setUp(self):
     self.unoObjs = testutil.unoObjsForCurrentDoc()
     self.locale = Locale()
     testutil.blankWriterDoc(self.unoObjs)
     self.dlgSettings = None
     self.dlgGrabEx = None
 def setUp(self):
     self.unoObjs = testutil.unoObjsForCurrentDoc()
     self.dlg = DlgDataConversion(self.unoObjs)
     self.availableFonts = styles.getListOfFonts(self.unoObjs)
 def setUp(self):
     self.unoObjs = testutil.unoObjsForCurrentDoc()
     self.dlg = DlgAbbreviations(self.unoObjs)
Ejemplo n.º 19
0
 def setUp(self):
     self.unoObjs = testutil.unoObjsForCurrentDoc()
     self.outdir = testutil.output_path("all_scope_types")
Ejemplo n.º 20
0
def doTests():
    unoObjs = testutil.unoObjsForCurrentDoc()
    userVars = UserVars("LTg_", unoObjs.document, logger)
    GrammarStyles(unoObjs, userVars).createStyles()
    GrammarTags(userVars).loadUserVars()
    resetUserVars(userVars)
    allRefNums = ["JPDN60.01", "Hunt06", "Hunt39"]
    #allRefNums = ["JPDN60.01"]
    #allRefNums = ["FW-1.1", "FW-1.2", "FW-2.1"]

    ## Just do one test

    #userVars.store('MakeOuterTable', "0")
    #userVars.store('Method', "tables")
    #userVars.store('InsertNumbering', "1")
    #doCall("JPDN60.01", unoObjs)
    #return

    ## Basic tests

    #numTests = len(allRefNums)
    #msgr.write(DASHES + "Basic Tests (" + str(numTests) + " tests)" + DASHES)
    #msgr.endl()
    #for exrefnum in allRefNums:
    #    doCall(exrefnum, unoObjs)
    #return  # do only basic tests

    ## Showing / hiding lines

    resetUserVars(userVars)
    numTests = 2 * 2 * 2 * 2 * 2 * 2 * 2 * len(allRefNums)
    msgr.endl()
    msgr.write(DASHES + "Showing / hiding lines (" + str(numTests) +
               " tests)" + DASHES)
    msgr.endl()
    for method in ["frames", "tables"]:
        msgr.write("Method = " + method)
        for separateMorphCols in ["0", "1"]:
            msgr.write("SeparateMorphColumns = " + separateMorphCols)
            for showText in ["1", "0"]:
                msgr.write("ShowText = " + showText)
                for showMorphBreaks in ["1", "0"]:
                    msgr.write("ShowMorphBreaks = " + showMorphBreaks)
                    for showOrtho in ["0", "1"]:
                        msgr.write("ShowOrthoTextLine = " + showOrtho)
                        for showPOS in ["1", "0"]:
                            msgr.write("ShowPartOfSpeech = " + showPOS)
                            for aboveGloss in ["0", "1"]:
                                if showPOS == 0 and aboveGloss != 0:
                                    continue
                                msgr.write("POS_AboveGloss = " + aboveGloss)
                                msgr.endl()
                                for exrefnum in allRefNums:
                                    userVars.store('Method', method)
                                    userVars.store('ShowText', showText)
                                    userVars.store('ShowMorphBreaks',
                                                   showMorphBreaks)
                                    userVars.store('ShowPartOfSpeech', showPOS)
                                    userVars.store('POS_AboveGloss',
                                                   aboveGloss)
                                    userVars.store("SeparateMorphColumns",
                                                   separateMorphCols)
                                    userVars.store('ShowOrthoTextLine',
                                                   showOrtho)
                                    doCall(exrefnum, unoObjs)

    ## Numbering

    resetUserVars(userVars)
    numTests = 2 * 2 * 2 * len(allRefNums) + 4 * len(allRefNums)
    msgr.endl()
    msgr.write(DASHES + "Numbering (" + str(numTests) + " tests)" + DASHES)
    msgr.endl()
    for makeOuterTable in ["1", "0"]:
        msgr.write("MakeOuterTable = " + makeOuterTable)
        for method in ["frames", "tables"]:
            msgr.write("Method = " + method)
            for insertNumbering in ["1", "0"]:
                msgr.write("InsertNumbering = " + insertNumbering)
                for separateMorphCols in ["0", "1"]:
                    msgr.write("SeparateMorphColumns = " + separateMorphCols)
                    msgr.endl()
                    for exrefnum in allRefNums:
                        userVars.store('MakeOuterTable', makeOuterTable)
                        userVars.store('Method', method)
                        userVars.store("SeparateMorphColumns",
                                       separateMorphCols)
                        userVars.store('InsertNumbering', insertNumbering)
                        doCall(exrefnum, unoObjs)
    resetUserVars(userVars)
    for method in ["frames", "tables"]:
        msgr.write("Method = " + method)
        for numberingColWidth in ["7", "10", "50"]:
            msgr.write("NumberingColWidth = " + numberingColWidth)
            msgr.endl()
            for exrefnum in allRefNums:
                userVars.store('Method', method)
                userVars.store('NumberingColWidth', numberingColWidth)
                doCall(exrefnum, unoObjs)
Ejemplo n.º 21
0
 def setUp(self):
     self.unoObjs = testutil.unoObjsForCurrentDoc()
     self.msgbox = MessageBox(self.unoObjs)
 def setUp(self):
     self.unoObjs = testutil.unoObjsForCurrentDoc()
     self.dlgSettings = None
     self.dlgGrabEx = None
Ejemplo n.º 23
0
 def setUp(self):
     self.unoObjs = testutil.unoObjsForCurrentDoc()
     USERVAR_PREFIX = "LTp_"  # LinguisticTools Phonology variables
     self.userVars = UserVars(USERVAR_PREFIX, self.unoObjs.document, logger)
 def tearDown(self):
     # close() might throw exception, in which case try calling dispose().
     self.calcUnoObjs.document.close(True)
     unoObjs = testutil.unoObjsForCurrentDoc()
     testutil.blankWriterDoc(unoObjs)
Ejemplo n.º 25
0
 def setUp(self):
     self.unoObjs = testutil.unoObjsForCurrentDoc()
     self.userVars = UserVars(Prefix.INTERLINEAR, self.unoObjs.document,
                              logger)
Ejemplo n.º 26
0
 def setUp(self):
     fileItem = WordListFileItem(None)
     self.unoObjs = testutil.unoObjsForCurrentDoc()
     self.dlg = DlgWordListFile(fileItem, self.unoObjs, None)
 def setUp(self):
     self.unoObjs = testutil.unoObjsForCurrentDoc()
     self.dlg = DlgDataConversion(self.unoObjs)
Ejemplo n.º 28
0
 def setUp(self):
     self.unoObjs = testutil.unoObjsForCurrentDoc()
     self.userVars = UserVars(Prefix.PHONOLOGY, self.unoObjs.document,
                              logger)
Ejemplo n.º 29
0
 def setUp(self):
     self.unoObjs = testutil.unoObjsForCurrentDoc()
     self.dlg = None
 def tearDownClass(cls):
     unoObjs = testutil.unoObjsForCurrentDoc()
     unoObjs.dispatcher.executeDispatch(unoObjs.frame, ".uno:SelectTable",
                                        "", 0, ())
     unoObjs.dispatcher.executeDispatch(unoObjs.frame, ".uno:DeleteTable",
                                        "", 0, ())