forked from stephengrice/onenote-to-markdown
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestPathComponentScrubber.py
34 lines (26 loc) · 1.26 KB
/
TestPathComponentScrubber.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
import unittest
from path_scrubbing.PathComponentScrubber import PathComponentScrubber
class TestPathComponentScrubber(unittest.TestCase):
param_list = [
('6/2/2014 8:04 AM Office Lens', '201406020804 Office Lens'),
('+Checklist', '+Checklist'),
('2019_08_19 4_01 PM Office Lens', '201908191601 Office Lens'),
('2"x4"N - Src 1', '2”x4”N - Src 1'),
('OCL: Diag: Lumber', 'OCL — Diag — Lumber'),
('"Something funny happened"', '“Something funny happened”'),
('Plywood 3/4"', 'Plywood 3∕4”'),
('**My favorite page**', '**My favorite page**'),
('That is the question?', 'That is the question?'),
('All | these | worlds', 'All | these | worlds'),
]
def test_path_component_cleanup_returns_expected(self):
for input_path_component, expected in self.param_list:
with self.subTest(input_path_component=input_path_component, expected=expected):
# Arrange
subject = PathComponentScrubber()
# Act
actual = subject.cleanup_path_component(input_path_component).name
# Assert
self.assertEqual(actual, expected)
if __name__ == '__main__':
unittest.main()