summaryrefslogtreecommitdiff
path: root/tests/analysis/db/items/comment.py
blob: 531756ca3d78a8f9a1fbc9a76735701ddbe42f80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/python3-dbg
# -*- coding: utf-8 -*-


# Tests validant la manipulation des commentaires


from chrysacase import ChrysalideTestCase
from pychrysalide.analysis.db.items import DbComment
from pychrysalide.glibext import BufferLine


class TestDbComment(ChrysalideTestCase):
    """TestCase for analysis.db.items.DbComment."""


    def testCreation(self):
        """Ensure comments are buildable from Python."""

        c0 = DbComment(0, BufferLine.BLF_HAS_CODE, repeatable=True)

        self.assertIsNotNone(c0)

        with self.assertRaises(TypeError):

            c1 = DbComment(0, BufferLine.BLF_HAS_CODE, text=None, before=False)

        c2 = DbComment(0, BufferLine.BLF_HAS_CODE, text='None', before=False)

        self.assertIsNotNone(c2)