forgot to add the test file

This commit is contained in:
Job Evers-Meltzer 2016-07-26 09:34:00 -05:00
parent 3814912adf
commit 927b9afe7c
2 changed files with 22 additions and 0 deletions

3
.gitignore vendored
View file

@ -25,3 +25,6 @@ lbrynet.egg-info/PKG-INFO
*.decTest
.coverage
# temporary files from the twisted.trial test runner
_trial_temp/

View file

@ -0,0 +1,19 @@
from lbrynet.core import utils
from twisted.trial import unittest
class CompareVersionTest(unittest.TestCase):
def test_compare_versions_isnot_lexographic(self):
self.assertTrue(utils.version_is_greater_than('0.3.10', '0.3.6'))
def test_same_versions_return_false(self):
self.assertFalse(utils.version_is_greater_than('1.3.9', '1.3.9'))
def test_same_release_is_greater_then_beta(self):
self.assertTrue(utils.version_is_greater_than('1.3.9', '1.3.9b1'))
def test_version_can_have_four_parts(self):
self.assertTrue(utils.version_is_greater_than('1.3.9.1', '1.3.9'))