-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest_enron_util.py
71 lines (56 loc) · 2.04 KB
/
test_enron_util.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import unittest
from .enron_util import truncate_message
class TruncateMessageTest(unittest.TestCase):
def run_template(self, useful, junk):
msg = '{}{}'.format(
useful, junk
)
self.assertEqual(
useful,
truncate_message(msg)
)
def test_truncate_message_1(self):
self.run_template(
'His extension is 3-5612. Vince ',
'-----Original Message----- From: \\'
)
def test_truncate_message_2(self):
self.run_template(
'I already complied? ',
'---------------------- Forwarded by Steven J Kean/NA/Enron on 07/11/2001 01:19 PM --------------------------- '
)
def test_truncate_message_3(self):
self.run_template(
'His extension is 3-5612. Vince ',
'-----original message----- From: \\'
)
def test_truncate_message_4(self):
self.run_template(
'His extension is 3-5612. Vince ----nice',
''
)
def test_truncate_message_5(self):
self.run_template(
'when we merged in 1997. ',
'---------------------- Forwarded by Steven'
)
def test_truncate_message_6(self):
self.run_template(
'Best, Jeff ',
'********************************************************************** Financial California'
)
def test_truncate_message_7(self):
self.run_template(
'aaa ',
'JAMES@ENRON COMMUNICATIONS 07/05/2001 01:09 PM'
)
def test_truncate_message_8(self):
self.run_template(
'gloves off. James D Steffes ',
'07/06/2001 10:04 PM To: Jeffrey T Hodge/Enron@EnronXGate, Robert'
)
def test_truncate_message_8(self):
self.run_template(
'"wgramm" ',
'<wgramm@osf1.gmu.edu> on 07/17/2001 03:23:19 PM Please respond to <wgramm@osf1.gmu.edu> To: "Jerry Ellig" <jellig@gmu.edu>, "Steve Kean" <skean'
)