summaryrefslogtreecommitdiff
path: root/tests/analysis
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2021-10-08 06:52:02 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2021-10-08 06:52:02 (GMT)
commit0aea964ab880a972e8a4d54b36f7eee340f49d5b (patch)
tree64b09b80f5d92e96a18a73188197eff5241a2687 /tests/analysis
parentda3da13a32a2f98c16a591a389e274a7803fc48a (diff)
Extract filenames when creating content attributes.
Diffstat (limited to 'tests/analysis')
-rw-r--r--tests/analysis/cattribs.py42
1 files changed, 21 insertions, 21 deletions
diff --git a/tests/analysis/cattribs.py b/tests/analysis/cattribs.py
index 1a7f7da..e388afc 100644
--- a/tests/analysis/cattribs.py
+++ b/tests/analysis/cattribs.py
@@ -15,10 +15,10 @@ class TestProjectFeatures(ChrysalideTestCase):
def testEmptyContentAttributeSet(self):
"""Check properties of empty content attribute set."""
- attribs = ContentAttributes('')
- self.assertIsNotNone(attribs)
+ attribs, filename = ContentAttributes('')
- self.assertIsNone(attribs.filename)
+ self.assertIsNotNone(attribs)
+ self.assertIsNone(filename)
self.assertEqual(len(attribs.keys), 0)
@@ -33,16 +33,16 @@ class TestProjectFeatures(ChrysalideTestCase):
'dddd': '3',
}
- filename = 'filename'
- path = filename
+ orig_filename = 'filename'
+ path = orig_filename
for k in model.keys():
path += '&%s=%s' % (k, model[k])
- attribs = ContentAttributes(path)
- self.assertIsNotNone(attribs)
+ attribs, filename = ContentAttributes(path)
- self.assertEqual(attribs.filename, filename)
+ self.assertIsNotNone(attribs)
+ self.assertEqual(orig_filename, filename)
kcount = 0
@@ -73,10 +73,10 @@ class TestProjectFeatures(ChrysalideTestCase):
for k in model.keys():
path += '&e%s=%s' % (k, model[k])
- attribs = ContentAttributes(path)
- self.assertIsNotNone(attribs)
+ attribs, filename = ContentAttributes(path)
- self.assertIsNone(attribs.filename)
+ self.assertIsNotNone(attribs)
+ self.assertIsNone(filename)
kcount = 0
@@ -92,31 +92,31 @@ class TestProjectFeatures(ChrysalideTestCase):
path = '&&'
- attribs = ContentAttributes(path)
- self.assertIsNotNone(attribs)
+ attribs, filename = ContentAttributes(path)
- self.assertIsNone(attribs.filename)
+ self.assertIsNotNone(attribs)
+ self.assertIsNone(filename)
self.assertEqual(len(attribs.keys), 0)
path = '&&&'
- attribs = ContentAttributes(path)
- self.assertIsNotNone(attribs)
+ attribs, filename = ContentAttributes(path)
- self.assertIsNone(attribs.filename)
+ self.assertIsNotNone(attribs)
+ self.assertIsNone(filename)
self.assertEqual(len(attribs.keys), 0)
path = 'filename'
- attribs = ContentAttributes(path)
+ attribs, filename = ContentAttributes(path)
+
self.assertIsNotNone(attribs)
+ self.assertEqual(filename, path)
self.assertEqual(len(attribs.keys), 0)
- self.assertEqual(attribs.filename, path)
-
def testContentAttributesKeyAccess(self):
"""Test some access keys for content attributes."""
@@ -130,7 +130,7 @@ class TestProjectFeatures(ChrysalideTestCase):
for k in model.keys():
path += '&%s=%s' % (k, model[k])
- attribs = ContentAttributes(path)
+ attribs, _ = ContentAttributes(path)
self.assertIsNotNone(attribs)
with self.assertRaisesRegex(Exception, 'key must be a string value'):