Exemplo n.º 1
0
    def testDictToStr_01_empty(self):
        params = {}
        result = dictToStr(params)

        validResult = u''

        self.assertEqual(result, validResult)
Exemplo n.º 2
0
    def testDictToStr_01_empty(self):
        params = {}
        result = dictToStr(params)

        validResult = u''

        self.assertEqual(result, validResult)
Exemplo n.º 3
0
    def testDictToStr_02(self):
        params = {u'param1': 10}
        result = dictToStr(params)

        validResult = u'param1="10"'

        self.assertEqual(result, validResult)
Exemplo n.º 4
0
    def testDictToStr_02(self):
        params = {
            u'param1': 10
        }
        result = dictToStr(params)

        validResult = u'param1="10"'

        self.assertEqual(result, validResult)
Exemplo n.º 5
0
    def testDictToStr_07(self):
        params = {
            u'param1': 10,
            u'Параметр2': u'',
        }
        result = dictToStr(params)

        validResult = u'param1="10", Параметр2=""'

        self.assertEqual(result, validResult, result)
Exemplo n.º 6
0
    def testDictToStr_06(self):
        params = {
            u'param1': 10,
            u'Параметр2': u'аб\'ыр"валг',
        }
        result = dictToStr(params)

        validResult = u'param1="10", Параметр2="аб\'ыр\\"валг"'

        self.assertEqual(result, validResult, result)
Exemplo n.º 7
0
    def testDictToStr_05(self):
        params = {
            u'param1': 10,
            u'Параметр2': u'абыр"валг',
        }
        result = dictToStr(params)

        validResult = u'param1="10", Параметр2=\'абыр"валг\''

        self.assertEqual(result, validResult)
Exemplo n.º 8
0
    def testDictToStr_04(self):
        params = {
            u'param1': 10,
            u'Параметр2': u"абыр'валг",
        }
        result = dictToStr(params)

        validResult = u'param1="10", Параметр2="абыр\'валг"'

        self.assertEqual(result, validResult)
Exemplo n.º 9
0
    def testDictToStr_07(self):
        params = {
            u'param1': 10,
            u'Параметр2': u'',
        }
        result = dictToStr(params)

        validResult = u'param1="10", Параметр2=""'

        self.assertEqual(result, validResult, result)
Exemplo n.º 10
0
    def testDictToStr_06(self):
        params = {
            u'param1': 10,
            u'Параметр2': u'аб\'ыр"валг',
        }
        result = dictToStr(params)

        validResult = u'param1="10", Параметр2="аб\'ыр\\"валг"'

        self.assertEqual(result, validResult, result)
Exemplo n.º 11
0
    def testDictToStr_05(self):
        params = {
            u'param1': 10,
            u'Параметр2': u'абыр"валг',
        }
        result = dictToStr(params)

        validResult = u'param1="10", Параметр2=\'абыр"валг\''

        self.assertEqual(result, validResult)
Exemplo n.º 12
0
    def testDictToStr_04(self):
        params = {
            u'param1': 10,
            u'Параметр2': u"абыр'валг",
        }
        result = dictToStr(params)

        validResult = u'param1="10", Параметр2="абыр\'валг"'

        self.assertEqual(result, validResult)
Exemplo n.º 13
0
    def testDictToStr_03(self):
        params = {
            'param1': 10,
            'Параметр2': 'абырвалг',
        }
        result = dictToStr(params)

        validResult = 'param1="10", Параметр2="абырвалг"'

        self.assertEqual(result, validResult)
Exemplo n.º 14
0
    def getResult(self):
        params = dictToStr(self._getTableParams())

        if params:
            params = u' ' + params

        begin = u'<table{}>'.format(params)
        body = self._getRows()
        end = u'\n</table>'

        result = u''.join([begin, body, end])
        return result
Exemplo n.º 15
0
    def getResult (self):
        params = dictToStr (self._getTableParams ())

        if params:
            params = u' ' + params

        begin = u'<table{}>'.format (params)
        body = self._getRows()
        end = u'\n</table>'

        result = u''.join ([begin, body, end])
        return result
Exemplo n.º 16
0
    def getResult (self):
        """
        Return wiki notation string with (:table:)...(:tableend:) commands
        """
        params = dictToStr (self._getTableParams ())

        if params:
            params = u' ' + params

        begin = u'(:table{}{}:)'.format (self._suffix, params)
        body = self._getRows()
        end = u'\n(:table{}end:)'.format (self._suffix)

        result = u''.join ([begin, body, end])
        return result