Пример #1
0
 def testExtendedCamel(self):
     obj = Variations.VariationsBase()
     for label, identifier in [
         ("two words", "twoWords"),
         ("three wee words", "threeWeeWords"),
         ("\" hi \"", "quoteHiQuote"),
         ("!#$%age", "bangHashDollarPercentAge"),
         ("&'()*",
          "ampersandSingleQuoteLeftParenthesisRightParenthesisStar"),
         ("+,-./:", "plusCommaMinusDotSlashColon"),
         (";=?", "semicolonEqualsQuestion"),
         ("@[]\\", "atLeftSquareBracketRightSquareBracketBackslash"),
         ("^`{}~", "caretBackquoteLeftBraceRightBraceTilde"),
         ("cost $", "costDollar"),
         ("cost$", "costDollar"),
         ("!", "bang"),
         ("!!", "bangBang"),
         ("meet @", "meetAt"),
         ("*****@*****.**", "rickAtMugridgeDotCom"),
         ("", "blank"),
         ("2 words", "twoWords"),
         ("return", "return_"),
         (u"\u216C", u"u216C"),
         (u"\u216D\uFFFE", u"u216DuFFFE"),
         (u"\uFFFF", u"uFFFF"),
         (u"\u0041b", u"Ab"),
     ]:
         result = obj._extendedLabelMapping(label)
         assert result == identifier, (
             "'%s' should transform to: '%s' is: '%s'" %
             (label, identifier, result))
Пример #2
0
 def testCamel(self):
     obj = Variations.VariationsBase()
     for header, identifier in [
         ("hi there!", "hiThere"),
         ("123.45", "one2345"),
         ("pass", "pass_"),
         ("try_this", "try_this"),  #0.8a2 was tryThis
         ("Leading caps", "LeadingCaps"),
         ("One2buckle My shoe", "One2buckleMyShoe"),
     ]:
         result = obj.camel(header)
         assert result == identifier, (
             "'%s' should transform to: '%s' is: '%s'" %
             (header, identifier, result))
Пример #3
0
 def setUp(self):
     print '%s %s' % (self.id(), self.shortDescription())
     setupFitGlobalForTests("Batch")
     self.obj = Variations.VariationsBase()