comparison MoinMoin/_tests/test_wikiutil.py @ 4958:897840f96acc

fix PEP8 issues in wikiutil.Version tests
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 22 Aug 2009 15:11:20 +0200
parents 6638f02fc4b0
children
comparison
equal deleted inserted replaced
4957:fba959635dcd 4958:897840f96acc
1042 1042
1043 class TestVersion(object): 1043 class TestVersion(object):
1044 def test_Version(self): 1044 def test_Version(self):
1045 Version = wikiutil.Version 1045 Version = wikiutil.Version
1046 # test properties 1046 # test properties
1047 assert Version(1,2,3).major == 1 1047 assert Version(1, 2, 3).major == 1
1048 assert Version(1,2,3).minor == 2 1048 assert Version(1, 2, 3).minor == 2
1049 assert Version(1,2,3).release == 3 1049 assert Version(1, 2, 3).release == 3
1050 assert Version(1,2,3,'4.5alpha6').additional == '4.5alpha6' 1050 assert Version(1, 2, 3, '4.5alpha6').additional == '4.5alpha6'
1051 # test Version init and Version to str conversion 1051 # test Version init and Version to str conversion
1052 assert str(Version(1)) == "1.0.0" 1052 assert str(Version(1)) == "1.0.0"
1053 assert str(Version(1,2)) == "1.2.0" 1053 assert str(Version(1, 2)) == "1.2.0"
1054 assert str(Version(1,2,3)) == "1.2.3" 1054 assert str(Version(1, 2, 3)) == "1.2.3"
1055 assert str(Version(1,2,3,'4.5alpha6')) == "1.2.3-4.5alpha6" 1055 assert str(Version(1, 2, 3, '4.5alpha6')) == "1.2.3-4.5alpha6"
1056 assert str(Version(version='1.2.3')) == "1.2.3" 1056 assert str(Version(version='1.2.3')) == "1.2.3"
1057 assert str(Version(version='1.2.3-4.5alpha6')) == "1.2.3-4.5alpha6" 1057 assert str(Version(version='1.2.3-4.5alpha6')) == "1.2.3-4.5alpha6"
1058 # test Version comparison, trivial cases 1058 # test Version comparison, trivial cases
1059 assert Version() == Version() 1059 assert Version() == Version()
1060 assert Version(1) == Version(1) 1060 assert Version(1) == Version(1)
1061 assert Version(1,2) == Version(1,2) 1061 assert Version(1, 2) == Version(1, 2)
1062 assert Version(1,2,3) == Version(1,2,3) 1062 assert Version(1, 2, 3) == Version(1, 2, 3)
1063 assert Version(1,2,3,'foo') == Version(1,2,3,'foo') 1063 assert Version(1, 2, 3, 'foo') == Version(1, 2, 3, 'foo')
1064 assert Version(1) != Version(2) 1064 assert Version(1) != Version(2)
1065 assert Version(1,2) != Version(1,3) 1065 assert Version(1, 2) != Version(1, 3)
1066 assert Version(1,2,3) != Version(1,2,4) 1066 assert Version(1, 2, 3) != Version(1, 2, 4)
1067 assert Version(1,2,3,'foo') != Version(1,2,3,'bar') 1067 assert Version(1, 2, 3, 'foo') != Version(1, 2, 3, 'bar')
1068 assert Version(1) < Version(2) 1068 assert Version(1) < Version(2)
1069 assert Version(1,2) < Version(1,3) 1069 assert Version(1, 2) < Version(1, 3)
1070 assert Version(1,2,3) < Version(1,2,4) 1070 assert Version(1, 2, 3) < Version(1, 2, 4)
1071 assert Version(1,2,3,'bar') < Version(1,2,3,'foo') 1071 assert Version(1, 2, 3, 'bar') < Version(1, 2, 3, 'foo')
1072 assert Version(2) > Version(1) 1072 assert Version(2) > Version(1)
1073 assert Version(1,3) > Version(1,2) 1073 assert Version(1, 3) > Version(1, 2)
1074 assert Version(1,2,4) > Version(1,2,3) 1074 assert Version(1, 2, 4) > Version(1, 2, 3)
1075 assert Version(1,2,3,'foo') > Version(1,2,3,'bar') 1075 assert Version(1, 2, 3, 'foo') > Version(1, 2, 3, 'bar')
1076 # test Version comparison, more delicate cases 1076 # test Version comparison, more delicate cases
1077 assert Version(1,12) > Version(1,9) 1077 assert Version(1, 12) > Version(1, 9)
1078 assert Version(1,12) > Version(1,1,2) 1078 assert Version(1, 12) > Version(1, 1, 2)
1079 assert Version(1,0,0,'0.0a2') > Version(1,0,0,'0.0a1') 1079 assert Version(1, 0, 0, '0.0a2') > Version(1, 0, 0, '0.0a1')
1080 assert Version(1,0,0,'0.0b1') > Version(1,0,0,'0.0a9') 1080 assert Version(1, 0, 0, '0.0b1') > Version(1, 0, 0, '0.0a9')
1081 assert Version(1,0,0,'0.0b2') > Version(1,0,0,'0.0b1') 1081 assert Version(1, 0, 0, '0.0b2') > Version(1, 0, 0, '0.0b1')
1082 assert Version(1,0,0,'0.0c1') > Version(1,0,0,'0.0b9') 1082 assert Version(1, 0, 0, '0.0c1') > Version(1, 0, 0, '0.0b9')
1083 assert Version(1,0,0,'1') > Version(1,0,0,'0.0c9') 1083 assert Version(1, 0, 0, '1') > Version(1, 0, 0, '0.0c9')
1084 # test Version playing nice with tuples 1084 # test Version playing nice with tuples
1085 assert Version(1,2,3) == (1,2,3,'') 1085 assert Version(1, 2, 3) == (1, 2, 3, '')
1086 assert Version(1,2,4) > (1,2,3) 1086 assert Version(1, 2, 4) > (1, 2, 3)
1087 1087
1088 1088
1089 coverage_modules = ['MoinMoin.wikiutil'] 1089 coverage_modules = ['MoinMoin.wikiutil']
1090 1090