def test_comparable_key(self): visitor = ShardingByProblemVisitor(Mock()) self.assertEqual(visitor.comparable_key(('1', '02')), 2)
def test_pretty_key(self): visitor = ShardingByProblemVisitor(Mock()) self.assertEqual(visitor.pretty_key(('1', '2')), 'Problem #2')
def test_key(self): visitor = ShardingByProblemVisitor(Mock()) self.assertEqual(visitor.build_key(Mock(problem_id='42')), '42')