Esempio n. 1
0
    def test_planet_get_species_2(self):
        p = Planet.get("Kashyyyk")
        species = p.get_species()
        expected = ["Wookiee"]

        # comparing the two list elements ignoring order
        result = not set(species).isdisjoint(expected)

        self.assertEqual(result, True)
Esempio n. 2
0
    def test_planet_get_species_3(self):
        p = Planet.get("Tatooine")
        species = p.get_species()
        expected = ["Jawa", "Human"]

        # comparing the two list elements ignoring order
        result = not set(species).isdisjoint(expected)

        self.assertEqual(result, True)
Esempio n. 3
0
    def test_planet_get_characters_3(self):
        p = Planet.get("Tatooine")
        characters = p.get_characters()
        char_name = [characters[i].name for i in range(len(characters))]
        expected = ["C-3PO", "Tusken Raiders", "Het Nkik", "Darth Vader", "Luke Skywalker", "Biggs Darklighter"]

        # comparing the two list elements ignoring order
        result = not set(char_name).isdisjoint(expected)

        self.assertEqual(result, True)
Esempio n. 4
0
    def test_planet_get_characters_2(self):
        p = Planet.get("Kashyyyk")
        characters = p.get_characters()
        char_name = [characters[i].name for i in range(len(characters))]
        expected = ["Chewbacca", "Lowbacca"]

        # comparing the two list elements ignoring order
        result = not set(char_name).isdisjoint(expected)

        self.assertEqual(result, True)
Esempio n. 5
0
    def test_get_planet_serialize_2(self):        
        expected = {
            "description": "Kamino (pronounced/k\u0259'mino\u028a/), also known as the Planet of Storms, was the watery world where the Clone Army of the Galactic Republic was created, as well as the Kamino Home Fleet. It was inhabited by a race of tall, elegant beings called the Kaminoans, who kept to themselves and were known for their cloning technology. Kamino was located just south of the Rishi Maze, and was governed by the Ruling Council, headed by the Prime Minister.",
            "image": "http://img2.wikia.nocookie.net/__cb20090527045541/starwars/images/thumb/a/a9/Eaw_Kamino.jpg/500px-Eaw_Kamino.jpg",
            "name": "Kamino",
            "region": "Wild Space\nExtra-galactic",
            "system": "Kamino system"
        }
        actual = Planet.get("Kamino").serialize
        bool_result = actual["description"] == expected["description"] and \
                        actual["image"] == expected["image"] and \
                        actual["name"] == expected["name"] and \
                        actual["region"] == expected["region"] and \
                        actual["system"] == expected["system"]

        self.assertEqual(True, bool_result)
Esempio n. 6
0
    def test_get_planet_serialize_1(self):
        expected = {
            "description": "Tatooine (pronounced/t\u00e6tu'in/; Jawaese: Tah doo Een e) was a desert world and the first planet in the binary Tatoo star system. It was part of the Arkanis sector in the Outer Rim Territories. It was inhabited by poor locals who mostly farmed moisture for a living. Other activities included used equipment retailing and scrap dealing. The planet was on the 5709-DC Shipping Lane, a spur of the Triellus Trade Route, which itself connected to the Sisar Run.",
            "image": "http://img2.wikia.nocookie.net/__cb20130226044533/starwars/images/thumb/1/18/Tatooine3.png/500px-Tatooine3.png",
            "name": "Tatooine",
            "region": "Outer Rim Territories",
            "system": "Tatoo system"
        }
        actual = Planet.get("Tatooine").serialize
        bool_result = actual["description"] == expected["description"] and \
                        actual["image"] == expected["image"] and \
                        actual["name"] == expected["name"] and \
                        actual["region"] == expected["region"] and \
                        actual["system"] == expected["system"]

        self.assertEqual(True, bool_result)
Esempio n. 7
0
 def test_get_planet_3(self):
     p = Planet.get("Tatooine")
     self.assertEqual(p.name, "Tatooine")
     self.assertEqual(p.region, "Outer Rim Territories")
     self.assertEqual(p.system, "Tatoo system")
Esempio n. 8
0
 def test_get_planet_2(self):
     p = Planet.get("Kashyyyk")
     self.assertEqual(p.name, "Kashyyyk")
     self.assertEqual(p.region, "Mid Rim")
     self.assertEqual(p.system, "Kashyyyk system")
Esempio n. 9
0
 def test_get_planet_1(self):
     p = Planet.get("Kamino")
     self.assertEqual(p.name, "Kamino")
     self.assertEqual(p.region, "Wild Space\nExtra-galactic")
     self.assertEqual(p.system, "Kamino system")
Esempio n. 10
0
 def test_planet_repr_2(self):
     actual = str(Planet.get("Tatooine"))
     self.assertEqual(actual, "<name Tatooine>")
Esempio n. 11
0
 def test_planet_repr_1(self):
     actual = str(Planet.get("Kashyyyk"))
     self.assertEqual(actual, "<name Kashyyyk>")