2016-09-16 04:20:00 +02:00
|
|
|
from twisted.trial import unittest
|
2017-06-26 03:04:33 +02:00
|
|
|
from lbrynet.daemon import DaemonCLI
|
2016-09-16 04:20:00 +02:00
|
|
|
|
|
|
|
|
2016-09-26 03:35:37 +02:00
|
|
|
class DaemonCLITests(unittest.TestCase):
|
2016-09-16 04:20:00 +02:00
|
|
|
def test_guess_type(self):
|
2016-09-26 03:35:37 +02:00
|
|
|
self.assertEqual('0.3.8', DaemonCLI.guess_type('0.3.8'))
|
|
|
|
self.assertEqual(0.3, DaemonCLI.guess_type('0.3'))
|
|
|
|
self.assertEqual(3, DaemonCLI.guess_type('3'))
|
|
|
|
self.assertEqual('VdNmakxFORPSyfCprAD/eDDPk5TY9QYtSA==', DaemonCLI.guess_type('VdNmakxFORPSyfCprAD/eDDPk5TY9QYtSA=='))
|
|
|
|
self.assertEqual(0.3, DaemonCLI.guess_type('0.3'))
|
2017-03-23 22:44:06 +01:00
|
|
|
self.assertEqual(True, DaemonCLI.guess_type('TRUE'))
|
|
|
|
self.assertEqual(True, DaemonCLI.guess_type('true'))
|
|
|
|
self.assertEqual(True, DaemonCLI.guess_type('True'))
|
|
|
|
self.assertEqual(False, DaemonCLI.guess_type('FALSE'))
|
|
|
|
self.assertEqual(False, DaemonCLI.guess_type('false'))
|
|
|
|
self.assertEqual(False, DaemonCLI.guess_type('False'))
|
2017-08-14 17:52:51 +02:00
|
|
|
|
|
|
|
|
|
|
|
self.assertEqual('3', DaemonCLI.guess_type('3', key="uri"))
|
|
|
|
self.assertEqual('0.3', DaemonCLI.guess_type('0.3', key="uri"))
|
|
|
|
self.assertEqual('True', DaemonCLI.guess_type('True', key="uri"))
|
|
|
|
self.assertEqual('False', DaemonCLI.guess_type('False', key="uri"))
|
|
|
|
|
|
|
|
self.assertEqual('3', DaemonCLI.guess_type('3', key="file_name"))
|
|
|
|
self.assertEqual('3', DaemonCLI.guess_type('3', key="name"))
|
|
|
|
self.assertEqual('3', DaemonCLI.guess_type('3', key="download_directory"))
|
|
|
|
self.assertEqual('3', DaemonCLI.guess_type('3', key="channel_name"))
|
|
|
|
|
|
|
|
self.assertEqual(3, DaemonCLI.guess_type('3', key="some_other_thing"))
|