GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

Commit c8e385ba authored by Cecylia Bocovich's avatar Cecylia Bocovich

Add more test cases for different email styles

teor mentioned in ticket #23225 that some clients will top-post replies
without quoting the the text. This commit adds a test case for that.
Since the command detector is greedy, gettor parses the reply first.

Also added a test for bottom-posting.
parent 0cd6443c
......@@ -237,6 +237,39 @@ class EmailServiceTests(unittest.TestCase):
self.assertEqual(request["language"], "fa")
self.assertEqual(request["platform"], "linux")
request = ep.parse("From: \"silvia [hiro]\" <hiro@torproject.org>\n"
"Subject: Re: [GetTor] Help Email\r\n Reply-To: hiro@torproject.org \nTo:"
"gettor@torproject.org\nlinux fa\n\n"
"On 2020-02-10 11:54 a.m., gettor@torproject.org wrote:\n"
"This is how you can request a tor browser bundle link.\n"
"\n"
"Send an email to: gettor@torproject.org\n"
"\n"
"In the body of the email only write: <operating system> <language>.\n"
"\n"
"We only support windows, osx and linux as operating systems.\n"
"\n")
self.assertEqual(request["command"], "links")
self.assertEqual(request["language"], "fa")
self.assertEqual(request["platform"], "linux")
request = ep.parse("From: \"silvia [hiro]\" <hiro@torproject.org>\n"
"Subject: Re: [GetTor] Help Email\r\n Reply-To: hiro@torproject.org \nTo:"
"gettor@torproject.org\n"
"On 2020-02-10 11:54 a.m., gettor@torproject.org wrote:\n"
"> This is how you can request a tor browser bundle link.\n"
">\n"
"> Send an email to: gettor@torproject.org\n"
">\n"
"> In the body of the email only write: <operating system> <language>.\n"
">\n"
"> We only support windows, osx and linux as operating systems.\n"
">\n"
"linux fa\n\n")
self.assertEqual(request["command"], "links")
self.assertEqual(request["language"], "fa")
self.assertEqual(request["platform"], "linux")
request = ep.parse("From: \"silvia [hiro]\" <hiro@torproject.org>\n"
"Subject: Re: [GetTor] Help Email\r\n Reply-To: hiro@torproject.org \nTo:"
"gettor@torproject.org\n"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment