def test_parse_from_string_brief(self):
     reader = contentmlparser.ContentImplReader()
     reader.fromstring(contentml_brief)
     self.assertEquals(reader.desc, "")
     self.assertEquals(reader.outputs[0].dir, 'content')
     self.assertEquals(reader.outputs[0].inputs[0].dir, 'test')
     self.assertEquals(reader.outputs[0].inputs[0].include, {})
     self.assertEquals(reader.outputs[0].inputs[0].exclude, {})
    def test_parse_from_string_with_refs(self):
        reader = contentmlparser.ContentImplReader()
        reader.fromstring(contentml_with_refs)

        self.assertEquals(reader.outputs[0].dir, "${features.outputref}")
        self.assertEquals(reader.outputs[0].inputs[0].dir,
                          "${features.inputref}")
        self.assertEquals(reader.outputs[0].inputs[0].include,
                          {'pattern': ['${features.inputfilter}']})
 def test_content2_parse_multi(self):
     reader = contentmlparser.ContentImplReader()
     reader.fromstring(content2_multi)
     self.assertEquals(reader.outputs[0].dir, 'content')
     self.assertEquals(len(reader.outputs[0].inputs), 1)
     self.assertEquals(reader.outputs[0].inputs[0].dir, '')
     self.assertEquals(reader.outputs[0].inputs[0].include,
                       {'files': ['test/override.txt, test/s60.txt']})
     self.assertEquals(reader.outputs[1].inputs[0].file, 'test/s60.txt')
     self.assertEquals(reader.outputs[1].inputs[0].get_filelist(),
                       ['test/s60.txt'])
 def test_parse_from_string_with_phase(self):
     reader = contentmlparser.ContentImplReader()
     reader.fromstring(contentml_string_with_phase)
     self.assertEquals(reader.desc, 'Description field text')
     self.assertEquals(reader.outputs[0].dir, 'content')
     self.assertEquals(reader.outputs[0].inputs[0].dir, 'test')
     self.assertEquals(reader.outputs[0].inputs[0].include,
                       {'pattern': ['prod']})
     self.assertEquals(reader.outputs[0].inputs[0].exclude,
                       {'pattern': ['.svn']})
     self.assertEquals(reader.phase, 'pre')
 def test_external_content_parse_multi(self):
     reader = contentmlparser.ContentImplReader()
     reader.fromstring(external_content_multi)
     self.assertEquals(reader.outputs[0].dir, 'content')
     self.assertEquals(len(reader.outputs[0].inputs), 1)
     self.assertEquals(len(reader.outputs[1].inputs), 1)
     self.assertEquals(reader.outputs[0].inputs[0].dir,
                       'external_content/folder1')
     self.assertEquals(reader.outputs[0].inputs[0].include, {})
     self.assertEquals(reader.outputs[1].inputs[0].dir, 'external_content')
     self.assertEquals(reader.outputs[1].inputs[0].include,
                       {'pattern': ['.txt']})
 def test_content2_parse_outputs(self):
     reader = contentmlparser.ContentImplReader()
     reader.fromstring(contentml2_string)
     self.assertEquals(reader.outputs[0].dir, 'content')
     self.assertEquals(len(reader.outputs[0].inputs), 1)
     self.assertEquals(reader.outputs[0].inputs[0].dir, 'test')
     self.assertEquals(reader.outputs[0].inputs[0].include,
                       {'pattern': ['prod']})
     self.assertEquals(reader.outputs[1].inputs[0].dir,
                       '${features.inputref}')
     self.assertEquals(reader.outputs[1].dir, '${features.outputref}')
     self.assertEquals(reader.tags, {
         'target': ['core', 'rofs3'],
         'test': ['foo']
     })
 def test_parse_from_string(self):
     reader = contentmlparser.ContentImplReader()
     reader.fromstring(contentml_string)
     self.assertEquals(reader.desc, 'Description field text')
     self.assertEquals(reader.outputs[0].dir, 'content')
     self.assertEquals(reader.outputs[0].inputs[0].dir, 'test')
     self.assertEquals(reader.outputs[0].inputs[0].include,
                       {'pattern': ['prod']})
     self.assertEquals(reader.outputs[0].inputs[0].exclude,
                       {'pattern': ['.svn']})
     self.assertEquals(reader.phase, None)
     self.assertEquals(reader.tags, {
         'target': ['core', 'rofs3'],
         'test': ['foo']
     })
 def test_parse_from_string_brief2(self):
     reader = contentmlparser.ContentImplReader()
     reader.fromstring(contentml_brief2)
     self.assertEquals(reader.desc, "")
     self.assertEquals(reader.outputs[0].dir, "")
     self.assertEquals(len(reader.outputs[0].inputs), 0)