]>
Commit | Line | Data |
---|---|---|
1 | """Tests for elpy.tests.support. Yep, we test test code.""" | |
2 | ||
3 | import unittest | |
4 | ||
5 | from elpy.tests.support import source_and_offset | |
6 | ||
7 | ||
8 | class TestSourceAndOffset(unittest.TestCase): | |
9 | def test_should_return_source_and_offset(self): | |
10 | self.assertEqual(source_and_offset("hello, _|_world"), | |
11 | ("hello, world", 7)) | |
12 | ||
13 | def test_should_handle_beginning_of_string(self): | |
14 | self.assertEqual(source_and_offset("_|_hello, world"), | |
15 | ("hello, world", 0)) | |
16 | ||
17 | def test_should_handle_end_of_string(self): | |
18 | self.assertEqual(source_and_offset("hello, world_|_"), | |
19 | ("hello, world", 12)) |