-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_data_input.py
More file actions
19 lines (15 loc) · 900 Bytes
/
test_data_input.py
File metadata and controls
19 lines (15 loc) · 900 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import unittest
from data_input import input_in_dict
class TestInputInDict(unittest.TestCase):
def test_input_in_dict_valid_input(self):
# Provide a lambda function that returns valid input
with self.assertRaises(ValueError):
input_in_dict('Line', input_func=lambda _: 500) #gives out Error, since 500 is a valid answer and doesn't raise a ValueError
def test_input_in_dict_valid_input(self):
# Provide a lambda function that returns invalid input
with self.assertRaises(ValueError):
input_in_dict('Line', input_func=lambda _: 'hm') #loops endless with:
#Wrong datatype. Please input a int64.
#Error occurred for column 'Line' with input 'hm'
if __name__ == '__main__':
unittest.main()