Exemplo n.º 1
0
    def test_sections(self):
        fLOG(__file__,
             self._testMethodName,
             OutputPrint=__name__ == "__main__")

        data = os.path.abspath(os.path.dirname(__file__))
        data = os.path.join(data, "data")
        repo = ProjectsRepository(data)
        if len(repo.Groups) != 2:
            for f in repo.Groups:
                fLOG(f)
            self.assertEqual(len(repo.Groups), 2)
        groups = list(sorted(repo.Groups))
        gr = groups[0]
        if gr is None or len(gr) < 2:
            raise Exception("Empty group '{0}'".format(gr))
        self.assertEqual(gr, 'group_el1')
        sections = repo.get_sections(gr)
        names = [k for k in sorted(sections)]
        self.assertEqual(
            names,
            ['', 'extrait', 'next', 'pitch', 'programme', 'rapport', 'title'])
        if sections["next"] != ['', '* module tweepy', '']:
            raise Exception(sections["next"])
        if sections["extrait"] != [
                '', '::', '', '    paragraphe 1', '', '    paragraphe 2', ''
        ]:
            raise Exception(sections["extrait"])
Exemplo n.º 2
0
    def test_sections(self):
        fLOG(__file__,
             self._testMethodName,
             OutputPrint=__name__ == "__main__")

        data = os.path.abspath(os.path.dirname(__file__))
        data = os.path.join(data, "data")
        repo = ProjectsRepository(data)
        if len(repo.Groups) != 2:
            for f in repo.Groups:
                fLOG(f)
            self.assertEqual(len(repo.Groups), 2)
        gr = repo.Groups[0]
        sections = repo.get_sections(gr)
        names = [k for k in sorted(sections)]
        assert names == [
            '', 'extrait', 'next', 'pitch', 'programme', 'rapport', 'title'
        ]
        #for k,v in sections.items(): fLOG(k,v)
        if sections["next"] != ['', '* module tweepy', '']:
            raise Exception(sections["next"])
        if sections["extrait"] != [
                '', '::', '', '    paragraphe 1', '', '    paragraphe 2', ''
        ]:
            raise Exception(sections["extrait"])
Exemplo n.º 3
0
    def test_emails(self):
        fLOG(__file__,
             self._testMethodName,
             OutputPrint=__name__ == "__main__")

        data = os.path.abspath(os.path.dirname(__file__))
        data = os.path.join(data, "data")
        repo = ProjectsRepository(data)
        self.assertEqual(len(repo.Groups), 2)
        gr = repo.Groups[0]
        emails = repo.get_emails(gr)
        fLOG(emails)
        self.assertEqual(emails, [
            '*****@*****.**', 'name.lastname@something',
            '*****@*****.**', 'name.lastname@something'
        ])
Exemplo n.º 4
0
    def test_emails(self):
        fLOG(__file__,
             self._testMethodName,
             OutputPrint=__name__ == "__main__")

        data = os.path.abspath(os.path.dirname(__file__))
        data = os.path.join(data, "data")
        repo = ProjectsRepository(data)
        self.assertEqual(len(repo.Groups), 2)
        groups = list(sorted(repo.Groups))
        gr = groups[0]
        if gr is None or len(gr) < 2:
            raise Exception("Empty group '{0}'".format(gr))
        self.assertEqual(gr, 'group_el1')
        emails = repo.get_emails(gr)
        self.assertEqual(emails, [
            '*****@*****.**', 'name.lastname@something',
            '*****@*****.**', 'name.lastname@something'
        ])