diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2018-12-28 17:28:26 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2018-12-28 17:28:26 (GMT) |
commit | 63d012bfab75840b789e144177ca73847ea989e7 (patch) | |
tree | e833613b772f76d4389efa950b9adbcd0ce6f6fb /tests/analysis/db | |
parent | df8dba24f7b01a507acd03659c8d4d4868dea143 (diff) |
Enabled the comment creation from Python.
Diffstat (limited to 'tests/analysis/db')
-rw-r--r-- | tests/analysis/db/items/__init__.py | 0 | ||||
-rw-r--r-- | tests/analysis/db/items/comment.py | 30 |
2 files changed, 30 insertions, 0 deletions
diff --git a/tests/analysis/db/items/__init__.py b/tests/analysis/db/items/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/analysis/db/items/__init__.py diff --git a/tests/analysis/db/items/comment.py b/tests/analysis/db/items/comment.py new file mode 100644 index 0000000..531756c --- /dev/null +++ b/tests/analysis/db/items/comment.py @@ -0,0 +1,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) |