예제 #1
0
    def test_getListOfOriginalSizeParagraphs(self):
        text = 'CryptoPricer full request\n\n\nbtc usd 0 all\n\n\nReturns the current price of 1 btc in: usd.\n\nThe price is an average of the btc quotation, or: price, on all the exchanges. It is computed by the crypto prices provider.\n\n\n\nNext section\n\n\nThis section explains the preceeding section'

        list = HelpUtil._getListOfOriginalSizeParagraphs(text)
        self.assertEqual(len(list), 11)
        self.assertEqual(list[0],'CryptoPricer full request')
        self.assertEqual(list[1],'\n\n')
        self.assertEqual(list[2],'btc usd 0 all')
        self.assertEqual(list[3],'\n\n')
        self.assertEqual(list[4],'Returns the current price of 1 btc in: usd.')
        self.assertEqual(list[5],'\n')
        self.assertEqual(list[6],'The price is an average of the btc quotation, or: price, on all the exchanges. It is computed by the crypto prices provider.')
        self.assertEqual(list[7],'\n\n\n')
        self.assertEqual(list[8],'Next section')
        self.assertEqual(list[9],'\n\n')
        self.assertEqual(list[10],'This section explains the preceeding section')
예제 #2
0
    def test_getListOfOriginalSizeParagraphsWithExclamationPoint(self):
        text = '[b][color=ff0000]IMPORTANT[/color][/b]: entering a full request wipes out all the previously entered partial request settings !'

        list = HelpUtil._getListOfOriginalSizeParagraphs(text)
        self.assertEqual(len(list), 1)
        self.assertEqual('[b][color=ff0000]IMPORTANT[/color][/b]: entering a full request wipes out all the previously entered partial request settings !', list[0])