comparison venv/lib/python2.7/site-packages/github/tests/Equality.py @ 0:d67268158946 draft

planemo upload commit a3f181f5f126803c654b3a66dd4e83a48f7e203b
author bcclaywell
date Mon, 12 Oct 2015 17:43:33 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:d67268158946
1 # -*- coding: utf-8 -*-
2
3 # ########################## Copyrights and license ############################
4 # #
5 # Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> #
6 # #
7 # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ #
8 # #
9 # PyGithub is free software: you can redistribute it and/or modify it under #
10 # the terms of the GNU Lesser General Public License as published by the Free #
11 # Software Foundation, either version 3 of the License, or (at your option) #
12 # any later version. #
13 # #
14 # PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
15 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
16 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
17 # details. #
18 # #
19 # You should have received a copy of the GNU Lesser General Public License #
20 # along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
21 # #
22 # ##############################################################################
23
24 import Framework
25
26
27 class Equality(Framework.TestCase):
28 def testUserEquality(self):
29 u1 = self.g.get_user("jacquev6")
30 u2 = self.g.get_user("jacquev6")
31 self.assertTrue(u1 == u2)
32 self.assertFalse(u1 != u2)
33 self.assertEqual(u1, u2)
34
35 def testUserDifference(self):
36 u1 = self.g.get_user("jacquev6")
37 u2 = self.g.get_user("OddBloke")
38 self.assertFalse(u1 == u2)
39 self.assertTrue(u1 != u2)
40 self.assertNotEqual(u1, u2)
41
42 def testBranchEquality(self):
43 # Erf, equality of NonCompletableGithubObjects will be difficult to implement
44 # because even their _rawData can differ. (Here, the avatar_url is not equal)
45 # (CompletableGithubObjects are compared by their API url, which is a good key)
46 r = self.g.get_user().get_repo("PyGithub")
47 b1 = r.get_branch("develop")
48 b2 = r.get_branch("develop")
49 self.assertNotEqual(b1._rawData, b2._rawData)