示例#1
0
文件: tests.py 项目: holysugar/heso
    def test_comment(self):
        heso = self._make_heso()
        application.create_heso(heso)
        reponame = self._get_diff_repos()[0]

        begin_comments = application.get_all_comment(reponame)
        for i in xrange(3):
            comment = "This is test comment number {0}.".format(i + 1)
            application.add_comment(reponame, comment)
            time.sleep(0.001)  # fixme: I don't want to use sleep!
        comments = application.get_all_comment(reponame)
        self.assertEqual(len(comments), len(begin_comments) + 3)
示例#2
0
文件: tests.py 项目: Epictetus/heso
    def test_comment(self):
        heso = {'description': "This is description.",
                'files': [{'filename': "heso_test.py",
                          'document': "import heso"}]}
        application.create_heso(heso)
        reponame = self._get_diff_repos()[0]

        begin_comments = application.get_all_comment(reponame)

        comment1 = "This is test comment 1."
        application.add_comment(reponame, comment1)
        time.sleep(0.001)  # fixme: I don't want to use sleep!

        comment2 = "This is test comment 2."
        application.add_comment(reponame, comment2)
        time.sleep(0.001)  # fixme: I don't want to use sleep!

        comment3 = "This is test comment 3."
        application.add_comment(reponame, comment3)

        comments = application.get_all_comment(reponame)

        self.assertEqual(len(comments), len(begin_comments) + 3)
        self.assertEqual(comments[-1], comment3)