def test_guess_prefixes(self):
        test_xml = "<Root><ns:Tag xmlns:ns='http://testprefixes.org'/></Root>"
        self.stub_vim_buffer(0, test_xml)

        a.guess_prefixes(0)

        self.assertEqual('let l:ns_prefixes = {' +
                        '"ns": "http://testprefixes.org",}',
                        VimModuleStub.commanded[0])
示例#2
0
    def test_guess_prefixes(self):
        test_xml = "<Root><ns:Tag xmlns:ns='http://testprefixes.org'/></Root>"
        self.stub_vim_buffer(0, test_xml)

        a.guess_prefixes(1)

        self.assertEqual(
            'let l:ns_prefixes = {' + '"ns": "http://testprefixes.org",}',
            VimModuleStub.commanded[0])
    def test_guess_prefixes_error(self):
        test_xml = "<Some><Malformed><Rubbish></Some>"
        self.stub_vim_buffer(0, test_xml)

        a.guess_prefixes(0)

        self.assertIn(
                'echo "An error occurred while guessing namespace prefixes:', 
                VimModuleStub.commanded[0])
示例#4
0
    def test_guess_prefixes_error(self):
        test_xml = "<Some><Malformed><Rubbish></Some>"
        self.stub_vim_buffer(0, test_xml)

        a.guess_prefixes(1)

        self.assertIn(
            'throw "An error occurred while guessing namespace prefixes:',
            VimModuleStub.commanded[0])