-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_task_02.py
36 lines (25 loc) · 888 Bytes
/
test_task_02.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Standard Library
import os
import unittest
# Dependencies
import pytest
# From apps
from day_01.task_02 import Task02
from tests.test_utils.get_input import get_input
class TestTask02(unittest.TestCase):
def test_failure(self):
file_content = ["1234"]
self.assertRaises(ValueError, Task02.solve, file_content)
def test_example_input_01(self):
file_content = get_input("tests/day_01/input_example_01.txt")
expected = 31
result = Task02.solve(file_content)
assert result == expected
@pytest.mark.skipif(
os.environ["TEST_ENV"] == "staging", reason="My input file is not added to git, only run this locally"
)
def test_real_input(self):
file_content = get_input("tests/day_01/input.txt")
expected = 18650129
result = Task02.solve(file_content)
assert result == expected