Bumping manifests a=b2g-bump
[gecko.git] / config / tests / unit-printprereleasesuffix.py
blob4cf8d2f0e0020357ffbed55ce3913c48b2155880
1 import unittest
3 import sys
4 import os.path
5 import mozunit
7 from printprereleasesuffix import get_prerelease_suffix
9 class TestGetPreReleaseSuffix(unittest.TestCase):
10 """
11 Unit tests for the get_prerelease_suffix function
12 """
14 def test_alpha_1(self):
15 """test 1a1 version string"""
16 self.c = get_prerelease_suffix('1a1')
17 self.assertEqual(self.c, ' 1 Alpha 1')
19 def test_alpha_10(self):
20 """test 1.2a10 version string"""
21 self.c = get_prerelease_suffix('1.2a10')
22 self.assertEqual(self.c, ' 1.2 Alpha 10')
24 def test_beta_3(self):
25 """test 1.2.3b3 version string"""
26 self.c = get_prerelease_suffix('1.2.3b3')
27 self.assertEqual(self.c, ' 1.2.3 Beta 3')
29 def test_beta_30(self):
30 """test 1.2.3.4b30 version string"""
31 self.c = get_prerelease_suffix('1.2.3.4b30')
32 self.assertEqual(self.c, ' 1.2.3.4 Beta 30')
34 def test_release_1(self):
35 """test 1.2.3.4 version string"""
36 self.c = get_prerelease_suffix('1.2.3.4')
37 self.assertEqual(self.c, '')
39 def test_alpha_1_pre(self):
40 """test 1.2a1pre version string"""
41 self.c = get_prerelease_suffix('1.2a1pre')
42 self.assertEqual(self.c, '')
44 def test_beta_10_pre(self):
45 """test 3.4b10pre version string"""
46 self.c = get_prerelease_suffix('3.4b10pre')
47 self.assertEqual(self.c, '')
49 def test_pre_0(self):
50 """test 1.2pre0 version string"""
51 self.c = get_prerelease_suffix('1.2pre0')
52 self.assertEqual(self.c, '')
54 def test_pre_1_b(self):
55 """test 1.2pre1b version string"""
56 self.c = get_prerelease_suffix('1.2pre1b')
57 self.assertEqual(self.c, '')
59 def test_a_a(self):
60 """test 1.2aa version string"""
61 self.c = get_prerelease_suffix('1.2aa')
62 self.assertEqual(self.c, '')
64 def test_b_b(self):
65 """test 1.2bb version string"""
66 self.c = get_prerelease_suffix('1.2bb')
67 self.assertEqual(self.c, '')
69 def test_a_b(self):
70 """test 1.2ab version string"""
71 self.c = get_prerelease_suffix('1.2ab')
72 self.assertEqual(self.c, '')
74 def test_plus(self):
75 """test 1.2+ version string """
76 self.c = get_prerelease_suffix('1.2+')
77 self.assertEqual(self.c, '')
79 if __name__ == '__main__':
80 mozunit.main()