import contextlib
import functools
import mock
import os
import re
import unittest


# Import Test Utils
from tests.lc_testutils import VimMockFactory
from tests.lc_testutils import fix_vim_module

# Import localcomplete
fix_vim_module()
from pylibs import localcomplete


class LocalCompleteTestsError(Exception):
    """
    The base exception for this module.
    """


class TestZipFlattenLongest(unittest.TestCase):

    def test_below_tail(self):
        zip_gen = localcomplete.zip_flatten_longest([1, 2], [11, 22, 33, 44])
        self.assertEqual(list(zip_gen), [1, 11, 2, 22, 33, 44])
 def test_dummy_vim_mock_raises_an_exception_when_not_patched(self):
     fix_vim_module()
     with self.assertRaises(LCTestUtilsError):
         sys.modules['vim'].command("echo")
Esempio n. 3
0
# You should have received a copy of the GNU Lesser General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

import contextlib
import functools
import mock
import os
import re
import unittest

# Import Test Utils
from tests.lc_testutils import VimMockFactory
from tests.lc_testutils import fix_vim_module

# Import localcomplete
fix_vim_module()
from pylibs import localcomplete


class LocalCompleteTestsError(Exception):
    """
    The base exception for this module.
    """


class TestZipFlattenLongest(unittest.TestCase):
    def test_below_tail(self):
        zip_gen = localcomplete.zip_flatten_longest([1, 2], [11, 22, 33, 44])
        self.assertEqual(list(zip_gen), [1, 11, 2, 22, 33, 44])

    def test_above_tail(self):
 def test_dummy_vim_mock_raises_an_exception_when_not_patched(self):
     fix_vim_module()
     with self.assertRaises(LCTestUtilsError):
         sys.modules['vim'].command("echo")