Ejemplo n.º 1
0
    def test_unranked_list_names_self_correctly(self):
        """Check that an unranked list correctly reports itself using the
        string naming convention"""
        from random import randint

        test_object = EntityList()
        test_object.is_ranked = False

        list_count = randint(1, 20)
        for x in range(0, list_count):
            entity = Entity(str(x))
            test_object.append(entity)

        self.assertEqual(
            str(list_count) + "u", test_object.code_string(),
            "Got an unexpected code_string")
Ejemplo n.º 2
0
 def test_entitylist_can_be_set_ranked(self):
     """Check that we can set the ranked attribute"""
     test_object = EntityList()
     test_object.is_ranked = True
     self.assertTrue(test_object.is_ranked,
                     "Should be possible to set an EntityList as ranked")