def test_removeEOLOnShiftedLinesContainingLineBreakCodeOnAllShiftedLinesFromFile(self): ''' Tests correct handling of shifted lines containing a forced line break. :return: ''' noEOLText = '' FILE_PATH = 'shifted_breaked_lines.txt' with open(FILE_PATH) as breakedLineFile: noEOLText = HelpUtil._removeEOLFromFile(breakedLineFile) self.assertEqual(''' [n]R = RT [n]M = Minute price (precision at the minute) [p] [n]C = Close price''', noEOLText)
def test_removeEOLFromFile(self): noEOLText = '' FILE_PATH = 'partial_help_breaked_lines.txt' with open(FILE_PATH) as breakedLineFile: noEOLText = HelpUtil._removeEOLFromFile(breakedLineFile) self.assertEqual('''[b][cr]Requesting RT and historical cryptocurrency prices[/b][/c] CryptoPricer supports two kinds of requests: full requests and partial requests. [b]Full request[/b] <crypto> <unit> <date time> <exchange> <options> <date time> possible values: [b][cy]0[/cy][/b] for RT [b][cy]21/12 or 21/12/19 or 21/12/2019[/c][/b]. If no year is specified, current year is assumed. If no time is specified, current time is assumed. [b][cy]21/12 8:34[/c][/b] --> current year assumed 21 8:34 --> here, since no month is specified, current month or previous month is assumed. 8:34 --> here, since no date is specified, current date is assumed. [b]WARNING[/b]: specifying time makes sense only for dates not older than 7 days. Prices older than 7 days are 'close' prices. Since there is no notion of a close price for crypto's, the last price of the date at UTC 23.59 is returned as 'close' price. [p] [b]Output price qualifiers[/b]: R = RT [n]M = Minute price (precision at the minute) [n]C = Close price Examples: assume we are on 16/12/17 at 22:10 [cy]btc usd 0 bittrex[/c] --> [n]BTC/USD on BitTrex: 16/12/17 22:10R 19120 [cy]eth btc 16/12 13:45 bitfinex[/c] --> [n]ETH/BTC on Bitfinex: 16/12/17 13:45M 0.03893 [cy]eth btc 13:45 bitfinex[/c] --> [n]ETH/BTC on Bitfinex: 16/12/17 13:45M 0.03893 [cy]eth btc 15 8:45 bitfinex[/c] --> [n]ETH/BTC on Bitfinex: 15/12/17 8:45M 0.03782 [cy]eth btc 21/1 13:45 bitfinex[/c] --> [n]ETH/BTC on Bitfinex: 21/01/17C 0.01185 [cy]btc usd 0 bittrex -v0.01btc[/c] --> [n]0.01 BTC/191.2 USD on BitTrex: 16/12/17 22:10R 19120 [b][cr]WARNING[/c][/b]: <options> must be specified at the end of the full command price''', noEOLText)