Exemple #1
0
 def test_sort_by_trump_and_lead(self):
     self.assertEqual(sort_by_trump_and_lead('d', 'h', deal())[:12],
                      ['jd', 'jh', 'ad', 'kd', 'qd', '0d', '9d',
                       'ah', 'kh', 'qh', '0h', '9h'])
     self.assertEqual(sort_by_trump_and_lead('c', 'd', deal())[:13],
                      ['jc', 'js', 'ac', 'kc', 'qc', '0c', '9c',
                       'ad', 'kd', 'qd', 'jd', '0d', '9d'])
Exemple #2
0
 def test_playable_cards(self):
     self.assertEqual(playable_cards('c', 'd', deal()),
                      ['ad', 'kd', 'qd', 'jd', '0d', '9d'])
     self.assertEqual(playable_cards('c', 'c', deal()),
                      ['js', 'ac', 'kc', 'qc', 'jc', '0c', '9c'])
     self.assertEqual(playable_cards('c', 'c', deal()),
                      ['js', 'ac', 'kc', 'qc', 'jc', '0c', '9c'])
     self.assertEqual(playable_cards('c', 'c', ['ad']), ['ad'])
Exemple #3
0
 def test_playable_cards(self):
     self.assertEqual(playable_cards('c', 'd', deal()),
                      ['ad', 'kd', 'qd', 'jd', '0d', '9d'])
     self.assertEqual(playable_cards('c', 'c', deal()),
                      ['js', 'ac', 'kc', 'qc', 'jc', '0c', '9c'])
     self.assertEqual(playable_cards('c', 'c', deal()),
                      ['js', 'ac', 'kc', 'qc', 'jc', '0c', '9c'])
     self.assertEqual(playable_cards('c', 'c', ['ad']),
                      ['ad'])
Exemple #4
0
 def test_sort_by_trump_and_lead(self):
     self.assertEqual(
         sort_by_trump_and_lead('d', 'h', deal())[:12], [
             'jd', 'jh', 'ad', 'kd', 'qd', '0d', '9d', 'ah', 'kh', 'qh',
             '0h', '9h'
         ])
     self.assertEqual(
         sort_by_trump_and_lead('c', 'd', deal())[:13], [
             'jc', 'js', 'ac', 'kc', 'qc', '0c', '9c', 'ad', 'kd', 'qd',
             'jd', '0d', '9d'
         ])
Exemple #5
0
 def test_deal(self):
     self.assertEqual(deal(), [
         'ad', 'kd', 'qd', 'jd', '0d', '9d', 'ah', 'kh', 'qh', 'jh', '0h',
         '9h', 'as', 'ks', 'qs', 'js', '0s', '9s', 'ac', 'kc', 'qc', 'jc',
         '0c', '9c'
     ])
Exemple #6
0
 def test_deal(self):
     self.assertEqual(deal(),
                      ['ad', 'kd', 'qd', 'jd', '0d', '9d',
                       'ah', 'kh', 'qh', 'jh', '0h', '9h',
                       'as', 'ks', 'qs', 'js', '0s', '9s',
                       'ac', 'kc', 'qc', 'jc', '0c', '9c'])