#! /usr/bin/env python3


class Player:

    def __init__(self, name, rank):
        self.name = name
        self.rank = rank

    def __repr__(self):
        return '<{:s}(name={:s}, rank={:d})>'.format(self.__class__.__name__, self.name, self.rank)

    def __str__(self):
        rank_str = ''
        if self.rank < 0:
            rank_str = '{:d}K'.format(-self.rank)
        else:
            rank_str = '{:d}D'.format(self.rank)
        return '{:s} {:s}'.format(self.name, rank_str)


class Ladder:

    def __init__(self, standings):
        self.standings = standings

    def __str__(self):
        the_string = 'Ladder standings:'
        position = 1
        for player in self.standings:
            the_string += '\n    {:d}. {:s}'.format(position, str(player))
            position += 1
        return the_string

    def players(self):
        return set(self.standings)

    def match_valid(self, player_one, player_two):
        if not {player_one, player_two} < self.players():
            return False
        return True

if __name__ == '__main__':
    ladder = Ladder([Player('Andrew', -1), Player('Walther', 5), Player('Milan', -6)])
    print(ladder)

@@ -18,16 +18,33 @@
 ython3%0A%0A
+import unittest%0A%0A
 %0Aclass P
@@ -1055,16 +1055,424 @@
 n True%0A%0A
+%0Aclass LadderTestCase(unittest.TestCase):%0A%0A    def setUp(self):%0A        self.player_one = Player('Andrew', -1)%0A        self.player_two = Player('Walther', 5)%0A        self.player_three = Player('Milan', -6)%0A        self.ladder = Ladder(%5Bself.player_one, self.player_two, self.player_three%5D)%0A%0A    def test_match_valid(self):%0A        self.assertTrue(self.ladder.match_valid(self.player_one, self.player_two))%0A%0A%0A
 if __nam
@@ -1595,8 +1595,28 @@
 ladder)%0A
+    unittest.main()%0A

Add unittest, basic test to ladder.py