1 # Copyright 2011 Robert Lopez Toscano
3 # This file is part of Giterdone.
5 # Giterdone is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
10 # Giterdone is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with Giterdone. If not, see <http://www.gnu.org/licenses/>.
20 common_dir
= os
.path
.join(
21 os
.path
.dirname(os
.path
.dirname(os
.path
.realpath(__file__
))),
23 sys
.path
.append(common_dir
)
28 class CommonTestCase(unittest
.TestCase
):
30 def test_compare_versions_v1_greater(self
):
33 self
.assertTrue(common
.compare_versions(v1
, v2
) > 0)
37 self
.assertTrue(common
.compare_versions(v1
, v2
) > 0)
39 def test_compare_versions_v2_greater(self
):
42 self
.assertTrue(common
.compare_versions(v1
, v2
) < 0)
46 self
.assertTrue(common
.compare_versions(v1
, v2
) < 0)
48 def test_compare_versions_equal(self
):
51 self
.assertTrue(common
.compare_versions(v1
, v2
) == 0)
55 self
.assertTrue(common
.compare_versions(v1
, v2
) == 0)
57 if __name__
== '__main__':