def test_view_syntax_error(self):
    self.set_view_content('(ns foo.bar) (defn x [y] y')
    self.set_selections((0, 0))
    self.view.run_command('tutkain_evaluate', {'scope': 'view'})
    message = edn.read(self.server.backchannel.recv())
    id = message.get(edn.Keyword('id'))
    self.assertEquals({edn.Keyword('op'): edn.Keyword('load'), edn.Keyword('code'): base64.encode('(ns foo.bar) (defn x [y] y'.encode('utf-8')), edn.Keyword('file'): None, edn.Keyword('id'): id}, message)
    ex_message = '{:via [{:type clojure.lang.Compiler$CompilerException, :message "Syntax error reading source at (NO_SOURCE_FILE)"}]}'
    response = edn.kwmap({'id': id, 'tag': edn.Keyword('ret'), 'val': ex_message, 'exception': True})
    self.server.backchannel.send(response)
    self.assertEquals(response, self.get_print())
def test_view_syntax_error(self):
    self.set_view_content('(ns foo.bar) (defn x [y] y')
    self.set_selections((0, 0))
    self.view.run_command('tutkain_evaluate', {'scope': 'view'})
    message = edn.read(self.server.backchannel.recv())
    id = message.get(edn.Keyword('id'))
    self.assertEquals({edn.Keyword('op'): edn.Keyword('load'), edn.Keyword('code'): base64.encode('(ns foo.bar) (defn x [y] y'.encode('utf-8')), edn.Keyword('file'): None, edn.Keyword('id'): id}, message)
    ex_message = '{:via [{:type clojure.lang.Compiler$CompilerException, :message "Syntax error reading source at (NO_SOURCE_FILE)"}]}'
    response = edn.kwmap({'id': id, 'tag': edn.Keyword('ret'), 'val': ex_message, 'exception': True})
    self.server.backchannel.send(response)
    self.assertEquals(response, self.get_print())