-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
40 lines (34 loc) · 1.09 KB
/
Copy pathtest.py
File metadata and controls
40 lines (34 loc) · 1.09 KB
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
37
38
39
40
https://powcoder.com
代写代考加微信 powcoder
Assignment Project Exam Help
Add WeChat powcoder
https://powcoder.com
代写代考加微信 powcoder
Assignment Project Exam Help
Add WeChat powcoder
import unittest
from unittest.mock import patch
from collections import OrderedDict
import roman_arabic as roman
data = OrderedDict()
class Total_test(unittest.TestCase):
def test_roman(self):
for i in data:
input_test = [i]
with patch('builtins.input', side_effect=input_test):
with patch('builtins.print', side_effect=print) as mock:
roman.please_convert()
mock.assert_called_once_with(data[i])
data[i] = 'Success'
if __name__ == '__main__':
with open('test.txt') as file:
test_data = file.readlines()
for i in range(0, len(test_data), 2):
data[test_data[i][:-1]] = test_data[i + 1][:-1]
try:
unittest.main()
except:
for i in data:
if data[i] != 'Success':
print('You fail this case :', i)
break