Example #1
0
    def test_100_globe(self):
        globe = Globe(size=100)
        self.assertIsNotNone(globe)
        self.assertEqual(100, globe.size)
        self.assertEqual(10000, len(globe.locations))

        location_0_0 = globe.get_location(0, 0)
        self.assertIsNotNone(location_0_0)
        self.assertEqual(0, location_0_0.x)
        self.assertEqual(0, location_0_0.y)
        self.assertEqual((0, 0), location_0_0.coordinate)

        location_99_99 = globe.get_location(99, 99)
        self.assertIsNotNone(location_99_99)
        self.assertEqual(99, location_99_99.x)
        self.assertEqual(99, location_99_99.y)
        self.assertEqual((99, 99), location_99_99.coordinate)
Example #2
0
    def test_default_globe(self):
        globe = Globe()
        self.assertIsNotNone(globe)
        self.assertEqual(5, globe.size)
        self.assertEqual(25, len(globe.locations))

        location_0_0 = globe.get_location(0, 0)
        self.assertIsNotNone(location_0_0)
        self.assertEqual(0, location_0_0.x)
        self.assertEqual(0, location_0_0.y)
        self.assertEqual((0, 0), location_0_0.coordinate)

        location_4_4 = globe.get_location(4, 4)
        self.assertIsNotNone(location_4_4)
        self.assertEqual(4, location_4_4.x)
        self.assertEqual(4, location_4_4.y)
        self.assertEqual((4, 4), location_4_4.coordinate)