def test_get_last_release_without_release(self): from papaye.models import Package package = Package(name='package1') result = package.get_last_release() self.assertIsNone(result)
def test_get_last_release_with_alpha(self): from papaye.models import Package, Release package = Package(name='package1') package.releases.update([('1.0{}'.format(version), Release('', '1.0{}'.format(version), metadata={})) for version in ['', 'a1', 'a2', 'b1', 'b2', 'rc1']]) result = package.get_last_release() self.assertEqual(result.version, '1.0')
def test_get_last_release_with_minor(self): from papaye.models import Package, Release package = Package(name='package1') package.releases.update([( '1.{}'.format(index), Release('', '1.{}'.format(index), metadata={})) for index in range(1, 3)] ) result = package.get_last_release() self.assertEqual(result.version, '1.2')
def test_get_last_release_with_alpha(self): from papaye.models import Package, Release package = Package(name='package1') package.releases.update([ ('1.0{}'.format(version), Release('', '1.0{}'.format(version), metadata={})) for version in ['', 'a1', 'a2', 'b1', 'b2', 'rc1'] ]) result = package.get_last_release() self.assertEqual(result.version, '1.0')
def test_get_last_release_with_minor(self): from papaye.models import Package, Release package = Package(name='package1') package.releases.update([('1.{}'.format(index), Release('', '1.{}'.format(index), metadata={})) for index in range(1, 3)]) result = package.get_last_release() self.assertEqual(result.version, '1.2')