示例#1
0
 def fail(self):
     with test_loop() as loop:
         ctags = Ctags(None)
         p = Project.of('invalid', Path(temp_path('invalid')),
                        tpe=Just('c'), langs=List('c'))
         result = loop.run_until_complete(ctags.gen(p))
         result.success.should_not.be.ok
示例#2
0
文件: git_spec.py 项目: tek/proteome
 def wrapper(self):
     with test_loop() as loop:
         @curried
         def commit(msg, repo):
             coro = repo.add_commit_all(self.pro1, self.executor, msg)
             return loop.run_until_complete(coro)
         return self.hist.at(self.pro1, lambda r: f(self, r, commit))
示例#3
0
 def run(self):
     with test_loop() as loop:
         ctags = Ctags(None)
         p = Project.of(self.pypro1_name, self.pypro1_root,
                        tpe=Just(self.pypro1_type),
                        langs=List(self.pypro1_type))
         p.remove_tag_file()
         result = loop.run_until_complete(ctags.gen(p))
         result.success.should.be.ok
     p.tag_file.exists().should.be.ok
     ctags.current.k.should.be.empty
示例#4
0
 def commit(self):
     p1 = self.main_project
     p2 = self.mk_project('pro2', 'go')
     pros = List(p1, p2)
     hist = History(self.history_base)
     with self._prot(List(self.plug_name), pros=pros) as prot:
         with test_loop() as loop:
             prot.plug_command('history', 'StageIV', List())
             plug = prot.plugin('history').x
             self.test_file_1.write_text('test')
             prot.plug_command('history', 'Commit', List())
             self._await(plug.executor, loop)
     (hist.repo(p1) / _.history // _.head / repr).should.just
示例#5
0
 def prev_next(self):
     p1 = self.main_project
     p2 = self.mk_project('pro2', 'go')
     pros = List(p1, p2)
     with self._prot(List(self.plug_name), pros=pros) as prot:
         with test_loop() as loop:
             prot.plug_command('history', 'StageIV', List())
             self._three_commits(prot, loop)
             prot.plug_command('history', 'HistoryLog', List())
             prot.plug_command('history', 'HistoryPrev', List())
             prot.plug_command('history', 'HistoryLog', List())
             later(lambda: self.test_file_1.read_text()
                   .should.equal(self.test_content[1]))
             prot.plug_command('history', 'HistoryNext', List())
             later(lambda: self.test_file_1.read_text()
                   .should.equal(self.test_content[2]))
示例#6
0
 def ctags(self):
     plug_name = 'proteome.plugins.ctags'
     p1 = self.mk_project('pro1', 'c')
     p2 = self.mk_project('pro2', 'go')
     pros = List(p1, p2)
     with self._prot(List(plug_name), pros=pros) as prot:
         with test_loop() as loop:
             plug = prot.plugin('ctags')._get
             p1.tag_file.exists().should_not.be.ok
             p2.tag_file.exists().should_not.be.ok
             prot.plug_command('ctags', 'gen_all', List())
             def check(p):
                 plug.ctags.await_threadsafe(loop)
                 p.tag_file.exists().should.be.ok
             later(lambda: check(p1))
             later(lambda: check(p2))
             plug.ctags.ready.should.be.ok