()
| 212 | |
| 213 | |
| 214 | def test_euler_project(): |
| 215 | # Problem number 54 from Project Euler |
| 216 | # Testing from poker_hands.txt file |
| 217 | answer = 0 |
| 218 | script_dir = os.path.abspath(os.path.dirname(__file__)) |
| 219 | poker_hands = os.path.join(script_dir, "poker_hands.txt") |
| 220 | with open(poker_hands) as file_hand: |
| 221 | for line in file_hand: |
| 222 | player_hand = line[:14].strip() |
| 223 | opponent_hand = line[15:].strip() |
| 224 | player, opponent = PokerHand(player_hand), PokerHand(opponent_hand) |
| 225 | output = player.compare_with(opponent) |
| 226 | if output == "Win": |
| 227 | answer += 1 |
| 228 | assert answer == 376 |
nothing calls this directly
no test coverage detected