Back to index

enigmail  1.4.3
unit-printprereleasesuffix.py
Go to the documentation of this file.
00001 import unittest
00002 
00003 import sys
00004 import os.path
00005 sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
00006 
00007 from printprereleasesuffix import get_prerelease_suffix
00008 
00009 class TestGetPreReleaseSuffix(unittest.TestCase):
00010   """
00011   Unit tests for the get_prerelease_suffix function
00012   """
00013 
00014   def test_alpha_1(self):
00015     """test 1a1 version string"""
00016     self.c = get_prerelease_suffix('1a1')
00017     self.assertEqual(self.c, ' 1 Alpha 1')
00018 
00019   def test_alpha_10(self):
00020     """test 1.2a10 version string"""
00021     self.c = get_prerelease_suffix('1.2a10')
00022     self.assertEqual(self.c, ' 1.2 Alpha 10')
00023 
00024   def test_beta_3(self):
00025     """test 1.2.3b3 version string"""
00026     self.c = get_prerelease_suffix('1.2.3b3')
00027     self.assertEqual(self.c, ' 1.2.3 Beta 3')
00028 
00029   def test_beta_30(self):
00030     """test 1.2.3.4b30 version string"""
00031     self.c = get_prerelease_suffix('1.2.3.4b30')
00032     self.assertEqual(self.c, ' 1.2.3.4 Beta 30')
00033 
00034   def test_release_1(self):
00035     """test 1.2.3.4 version string"""
00036     self.c = get_prerelease_suffix('1.2.3.4')
00037     self.assertEqual(self.c, '')
00038 
00039   def test_alpha_1_pre(self):
00040     """test 1.2a1pre version string"""
00041     self.c = get_prerelease_suffix('1.2a1pre')
00042     self.assertEqual(self.c, '')
00043 
00044   def test_beta_10_pre(self):
00045     """test 3.4b10pre version string"""
00046     self.c = get_prerelease_suffix('3.4b10pre')
00047     self.assertEqual(self.c, '')
00048 
00049   def test_pre_0(self):
00050     """test 1.2pre0 version string"""
00051     self.c = get_prerelease_suffix('1.2pre0')
00052     self.assertEqual(self.c, '')
00053 
00054   def test_pre_1_b(self):
00055     """test 1.2pre1b version string"""
00056     self.c = get_prerelease_suffix('1.2pre1b')
00057     self.assertEqual(self.c, '')
00058 
00059   def test_a_a(self):
00060     """test 1.2aa version string"""
00061     self.c = get_prerelease_suffix('1.2aa')
00062     self.assertEqual(self.c, '')
00063 
00064   def test_b_b(self):
00065     """test 1.2bb version string"""
00066     self.c = get_prerelease_suffix('1.2bb')
00067     self.assertEqual(self.c, '')
00068 
00069   def test_a_b(self):
00070     """test 1.2ab version string"""
00071     self.c = get_prerelease_suffix('1.2ab')
00072     self.assertEqual(self.c, '')
00073 
00074   def test_plus(self):
00075     """test 1.2+ version string """
00076     self.c = get_prerelease_suffix('1.2+')
00077     self.assertEqual(self.c, '')
00078 
00079 if __name__ == '__main__':
00080   unittest.main()