From e4e82d3b81e50fc69fd4a929ff162f335b644ba0 Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Sun, 15 Jul 2018 13:42:22 +0200 Subject: Add simple test case for helper.parse_mailto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Johannes Löthberg --- tests/helper_test.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests') diff --git a/tests/helper_test.py b/tests/helper_test.py index b1300c7d..061ce122 100644 --- a/tests/helper_test.py +++ b/tests/helper_test.py @@ -487,3 +487,15 @@ class TestGetEnv(unittest.TestCase): with mock.patch.dict('os.environ', {self.env_name: custom_path}): self.assertEqual(helper.get_xdg_env(self.env_name, self.default), custom_path) + + +class TestParseMailto(unittest.TestCase): + + def test_parsing_working(self): + uri = 'mailto:test%40example.org?Subject=Re%3A%20Hello\ +&In-Reply-To=%3CC8CE9EFD-CB23-4BC0-B70D-9B7FEAD59F8C%40example.org%3E' + actual = helper.parse_mailto(uri) + expected = ({'To': ['test@example.org'], + 'Subject': ['Re: Hello'], + 'In-reply-to': ['']}, '') + self.assertEqual(actual, expected) -- cgit v1.2.3