summaryrefslogtreecommitdiff
path: root/tests/analysis/db
diff options
context:
space:
mode:
Diffstat (limited to 'tests/analysis/db')
-rw-r--r--tests/analysis/db/items/__init__.py0
-rw-r--r--tests/analysis/db/items/comment.py30
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)