1 from __future__
import absolute_import
6 from printprereleasesuffix
import get_prerelease_suffix
9 class TestGetPreReleaseSuffix(unittest
.TestCase
):
11 Unit tests for the get_prerelease_suffix function
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
, '')
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
, '')
60 """test 1.2aa version string"""
61 self
.c
= get_prerelease_suffix('1.2aa')
62 self
.assertEqual(self
.c
, '')
65 """test 1.2bb version string"""
66 self
.c
= get_prerelease_suffix('1.2bb')
67 self
.assertEqual(self
.c
, '')
70 """test 1.2ab version string"""
71 self
.c
= get_prerelease_suffix('1.2ab')
72 self
.assertEqual(self
.c
, '')
75 """test 1.2+ version string """
76 self
.c
= get_prerelease_suffix('1.2+')
77 self
.assertEqual(self
.c
, '')
80 if __name__
== '__main__':