diff options
author | Jauhien Piatlicki (jauhien) <piatlicki@gmail.com> | 2013-07-01 01:07:51 +0200 |
---|---|---|
committer | Jauhien Piatlicki (jauhien) <piatlicki@gmail.com> | 2013-07-01 01:07:51 +0200 |
commit | 5f037f6a973754545e32272abf677a9c48a473e6 (patch) | |
tree | 8c4badb04dc62d4d8c51221ad5690ee4e798e27d /tests | |
parent | g_sorcery/metadata: MetadataGenerator, metadata.xml schema (diff) | |
download | g-sorcery-5f037f6a973754545e32272abf677a9c48a473e6.tar.gz g-sorcery-5f037f6a973754545e32272abf677a9c48a473e6.tar.bz2 g-sorcery-5f037f6a973754545e32272abf677a9c48a473e6.zip |
g_sorcery/metadata: MetadataGenerator, xml generation by description
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_metadata.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/test_metadata.py b/tests/test_metadata.py index 8bec86b..aeaac6d 100644 --- a/tests/test_metadata.py +++ b/tests/test_metadata.py @@ -88,7 +88,16 @@ class TestMetadataGenerator(unittest.TestCase): def test_process(self): mg = DummyMetadataGenerator(None) - + description = {'herd' : ['test'], + 'maintainer' : [{'email' : 'test@example.com', 'name' : 'testor'}], + 'longdescription' : 'test metadata', + 'use' : {'flag' : [('flag1', 'test flag1'), ('flag2', 'test flag2')]}, + 'upstream' : {'maintainer' : [{'name' : 'TEST'}], 'remote-id' : '001'}} + self.assertEqual(ET.tostring(mg.process(None, description), encoding='unicode'), + '<pkgmetadata><herd>test</herd><maintainer><email>test@example.com</email>\ +<name>testor</name></maintainer><longdescription>test metadata</longdescription><use>\ +<flag name="flag1">test flag1</flag><flag name="flag2">test flag2</flag></use>\ +<upstream><maintainer><name>TEST</name></maintainer><remote-id>001</remote-id></upstream></pkgmetadata>') def suite(): suite = unittest.TestSuite() |