1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
import unittest
from mozharness.mozilla.release import get_previous_version
class TestGetPreviousVersion(unittest.TestCase):
def testESR(self):
self.assertEquals(
'31.5.3esr',
get_previous_version('31.6.0esr',
['31.5.3esr', '31.5.2esr', '31.4.0esr']))
def testReleaseBuild1(self):
self.assertEquals(
'36.0.4',
get_previous_version('37.0', ['36.0.4', '36.0.1', '35.0.1']))
def testReleaseBuild2(self):
self.assertEquals(
'36.0.4',
get_previous_version('37.0',
['37.0', '36.0.4', '36.0.1', '35.0.1']))
def testBetaMidCycle(self):
self.assertEquals(
'37.0b4',
get_previous_version('37.0b5', ['37.0b4', '37.0b3']))
def testBetaEarlyCycle(self):
# 37.0 is the RC build
self.assertEquals(
'38.0b1',
get_previous_version('38.0b2', ['38.0b1', '37.0']))
def testBetaFirstInCycle(self):
self.assertEquals(
'37.0',
get_previous_version('38.0b1', ['37.0', '37.0b7']))
def testTwoDots(self):
self.assertEquals(
'37.1.0',
get_previous_version('38.0b1', ['37.1.0', '36.0']))
|