<commit_before># Hack to allow import of ProjectEulerAnswers while it is still at top level.
from os import path
import sys
sys.path.append(path.dirname(path.dirname(path.dirname(path.abspath(__file__ )))))

import unittest

import ProjectEulerAnswers as pea


class TestEuler(unittest.TestCase):

    def test_prob1(self):
        self.assertEqual(pea.prob1(10), 23)

    def test_prob2(self):
        first_ten = (1, 2, 3, 5, 8, 13, 21, 34, 55, 89)
        even_sum = sum(i for i in first_ten if i % 2 == 0)
        self.assertEqual(pea.prob2(90), even_sum)

    def test_prob3(self):
        self.assertEqual(pea.prob3(13195), 29)

    def test_prob4(self):
        self.assertEqual(pea.prob4(2), 9009)

    def test_prob5(self):
        self.assertEqual(pea.prob5(10), 2520)

    def test_prob6(self):
        self.assertEqual(pea.prob6(10), 2640)

    def test_prob7(self):
        self.assertEqual(pea.prob7(6), 13)

    def test_prob10(self):
        # TODO: Check boundary is correct - open/closed
        self.assertEqual(pea.prob10(9), 17)

    def test_prob12(self):
        self.assertEqual(pea.prob12(5), 28)

    def test_prob15(self):
        self.assertEqual(pea.prob15(2), 6)

    def test_prob16(self):
        self.assertEqual(pea.prob16(15), 26)

    def test_prob17(self):
        self.assertEqual(pea.prob17(5), 19)

    def test_prob18(self):
        self.assertEqual(pea.prob18('triangle1.txt'), 23)

    def test_prob20(self):<commit_msg>Specify test data path from correct working dir<commit_after># Hack to allow import of ProjectEulerAnswers while it is still at top level.
from os import path
import sys
sys.path.append(path.dirname(path.dirname(path.dirname(path.abspath(__file__ )))))

import unittest

import ProjectEulerAnswers as pea


class TestEuler(unittest.TestCase):

    def test_prob1(self):
        self.assertEqual(pea.prob1(10), 23)

    def test_prob2(self):
        first_ten = (1, 2, 3, 5, 8, 13, 21, 34, 55, 89)
        even_sum = sum(i for i in first_ten if i % 2 == 0)
        self.assertEqual(pea.prob2(90), even_sum)

    def test_prob3(self):
        self.assertEqual(pea.prob3(13195), 29)

    def test_prob4(self):
        self.assertEqual(pea.prob4(2), 9009)

    def test_prob5(self):
        self.assertEqual(pea.prob5(10), 2520)

    def test_prob6(self):
        self.assertEqual(pea.prob6(10), 2640)

    def test_prob7(self):
        self.assertEqual(pea.prob7(6), 13)

    def test_prob10(self):
        # TODO: Check boundary is correct - open/closed
        self.assertEqual(pea.prob10(9), 17)

    def test_prob12(self):
        self.assertEqual(pea.prob12(5), 28)

    def test_prob15(self):
        self.assertEqual(pea.prob15(2), 6)

    def test_prob16(self):
        self.assertEqual(pea.prob16(15), 26)

    def test_prob17(self):
        self.assertEqual(pea.prob17(5), 19)

    def test_prob18(self):
        self.assertEqual(pea.prob18(path.join('..', '..', 'triangle1.txt')), 23)

    def test_prob20(self):
{'fraction_non_alphanumeric': 0.1270533020449212, 'fraction_numerical': 0.07241032517599731, 'mean_word_length': 3.115862068965517, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4411244', 'n_tokens_mistral': 1206, 'n_tokens_neox': 1041, 'n_words': 227}