예제 #1
0
 def test___ne__(self):
     region1 = Region(1, "USA")
     region2 = Region(1, "USA")
     region3 = Region(2, "USA")
     region4 = Region(1, "NL")
     self.assertFalse(region1.__ne__(region2))
     self.assertFalse(region2.__ne__(region1))
     self.assertTrue(region1.__ne__(region3))
     self.assertTrue(region1.__ne__(region4))
예제 #2
0
 def test_regions(self):
     credentials = Credentials("abc", "def")
     service = Service(credentials)
     response = {
         'status': 'OK',
         'regions': [
             {'name': 'Region 1', 'id': 1},
             {'name': 'Region 2', 'id': 2},
         ]
     }
     service.get = MagicMock(return_value=response)
     regions = Region.regions(service)
     self.assertEquals(len(regions), 2)
예제 #3
0
 def test___str__(self):
     region = Region(3, "def")
     self.assertEqual("3: def", region.__str__())
예제 #4
0
 def test___repr__(self):
     region = Region(3, "def")
     self.assertEqual("<3: def>", region.__repr__())