def test_parse_from_string_with_refs(self): reader = imageml.ImageImplReader() reader.fromstring(imageml_with_refs) self.assertEquals(reader.outputgenerators[0]._outputpath,'${features.outputref}') self.assertEquals(reader.outputgenerators[0].inputs[0]._path,'${features.inputref}') self.assertEquals(reader.outputgenerators[0].inputs[0].type,'dir') self.assertEquals(reader.outputgenerators[0].inputs[0].include,['${features.inputfilter}'])
def test_parse_from_string(self): reader = imageml.ImageImplReader() reader.fromstring(imageml_string) self.assertEquals(reader.desc,'') self.assertEquals(reader.outputgenerators[0].outputpath,'startup.mbm') self.assertEquals(reader.outputgenerators[0].inputs[0].path,'UI/Start-up Animation') self.assertEquals(reader.outputgenerators[0].inputs[0].type,'dir') self.assertEquals(reader.outputgenerators[0].inputs[0].include,['bmb$']) self.assertEquals(reader.outputgenerators[0].inputs[0].exclude,['.svn'])
def test_parse_inputs_with_files(self): etree = ElementTree.fromstring(input_files) reader = imageml.ImageImplReader() inputs = reader.parse_inputs(etree) self.assertEquals(inputs[0].path,'UI/graphics/icon1.bmb') self.assertEquals(inputs[0].depth,'8') self.assertEquals(inputs[1].path,'UI/graphics/icon2.bmb') self.assertEquals(inputs[1].depth,'8') self.assertEquals(inputs[2].path,'UI/graphics/icon3.bmb') self.assertEquals(inputs[2].depth,'8') self.assertEquals(inputs[3].path,'UI/graphics/icon4.bmb') self.assertEquals(inputs[3].depth,'8')
def test_parse_inputs_with_dir(self): etree = ElementTree.fromstring(input_dir) reader = imageml.ImageImplReader() inputs = reader.parse_inputs(etree) self.assertEquals(inputs[0].path,'UI/Start-up Animation') self.assertEquals(inputs[0].type,'dir') self.assertEquals(inputs[0].include, ['bmb$']) self.assertEquals(inputs[0].exclude, ['.svn']) self.assertEquals(inputs[0].depth,'8') self.assertEquals(inputs[0].test,'foo') self.assertEquals(inputs[1].path,'UI/Start-up Animation/masks') self.assertEquals(inputs[1].depth,'2')
def test_parse_outputs(self): etree = ElementTree.fromstring(imageml_string) reader = imageml.ImageImplReader() outputs = reader.parse_outputs(etree) self.assertEquals(outputs[0].outputpath,'startup.mbm') self.assertEquals(outputs[0].extraparams, '/V2') self.assertEquals(outputs[0].inputs[0].path,'UI/Start-up Animation') self.assertEquals(outputs[0].inputs[0].type,'dir') self.assertEquals(outputs[0].inputs[0].include,['bmb$']) self.assertEquals(outputs[0].inputs[0].exclude,['.svn']) self.assertEquals(outputs[1].outputpath,'shutdown.mbm') self.assertEquals(outputs[1].inputs[0].type,'file') self.assertEquals(outputs[1].inputs[0].path,'UI/graphics/icon1.bmb') self.assertEquals(outputs[1].inputs[1].type,'file') self.assertEquals(outputs[1].inputs[1].path,'UI/graphics/icon2.bmb') self.assertEquals(outputs[1].inputs[2].type,'file') self.assertEquals(outputs[1].inputs[2].path,'UI/graphics/icon3.bmb') self.assertEquals(outputs[1].inputs[3].type,'file') self.assertEquals(outputs[1].inputs[3].path,'UI/graphics/icon4.bmb')
def test_parse_input_include(self): etree = ElementTree.fromstring(input_dir) input = etree.find("{%s}input" % 'http://www.s60.com/xml/imageml/1') reader = imageml.ImageImplReader() include = reader.parse_input_include(input) self.assertEquals(include,{'pattern': ['bmb$']})
def test_parse_output(self): etree = ElementTree.fromstring(imageml_string) reader = imageml.ImageImplReader() outgens = reader.parse_outputs(etree) self.assertEquals(outgens[0].outputpath,'startup.mbm')