Go to the documentation of this file.00001 import report
00002 import unittest
00003
00004 class host_name(unittest.TestCase):
00005
00006 def test_ballista(self):
00007
00008 assert not report.is_stable_branch("ballista")
00009
00010 def test_onager(self):
00011
00012 assert not report.is_stable_branch("onager")
00013
00014 def test_sneffels(self):
00015
00016 assert report.is_stable_branch("sneffels.aoc.nrao.edu")
00017
00018
00019 def test_ma01(self):
00020
00021 assert report.is_stable_branch("ma01")
00022
00023
00024
00025 class version_test(unittest.TestCase):
00026
00027 def shortDescription(self):
00028 return "Unit tests of comparing version strings"
00029
00030 def test_r_r_1(self):
00031 "test revision vs revision"
00032 a = "CASA Version 3.0.1 (r10006)"
00033 b = "CASA Version 3.0.1 (r9933)"
00034
00035 self.order(b, a)
00036
00037 def test_r_r_2(self):
00038 a = "CASA Version 3.0.1 (r9936)"
00039 b = "CASA Version 3.0.1 (r9933)"
00040
00041 self.order(b, a)
00042
00043 def test_r_r_3(self):
00044 a = "CASA Version 3.0.0 (r9888)"
00045 b = "CASA Version 3.0.1 (r9913)"
00046
00047 self.order(a, b)
00048
00049 def test_build_build_1(self):
00050 a = "CASA Version 2.4.0 (build #8115)"
00051 b = "CASA Version 2.4.0 (build #7782)"
00052
00053 self.order(b, a)
00054
00055 def test_build_build_2(self):
00056 a = "CASA Version 2.4.0 (build #8115)"
00057 b = "CASA Version 3.0.0 (build #9684)"
00058
00059 self.order(a, b)
00060
00061 def test_build_r_1(self):
00062 a = "CASA Version 3.0.0 (r9886)"
00063 b = "CASA Version 3.0.0 (build #9684)"
00064
00065 self.order(b, a)
00066
00067 def test_build_r_2(self):
00068 a = "CASA Version 3.0.1 (r10006)"
00069 b = "CASA Version 3.0.0 (build #9684)"
00070
00071 self.order(b, a)
00072
00073 def order(self, a, b):
00074 """Verify that the cmp_version function behaves
00075 as it should, given that a is earlier than b"""
00076
00077 assert report.cmp_version(a, b) < 0
00078 assert report.cmp_version(b, a) > 0
00079 assert report.cmp_version(a, a) == 0
00080 assert report.cmp_version(b, b) == 0
00081
00082 def suite():
00083 return [version_test, host_name]