def testAggregatorScriptBuilding_partialSecondSource(self):
     provider = MetadataSourceAggregator(sources, map)
     (script, sourceIds) = provider._AggregatorScriptFor(
         ["Song::DynamicComplexity"])
     self.assertEquals(
         "copy 1 WaveFile::Complexity Song::DynamicComplexity\n" + "",
         script)
     self.assertEquals(["source2"], sourceIds)
 def testAggregatorScriptBuilding_severalSources(self):
     provider = MetadataSourceAggregator(sources, map)
     (script, sourceIds) = provider._AggregatorScriptFor(["Song::Artist", "Song::Title", "Song::DynamicComplexity"])
     self.assertEquals(
         "copy 1 File::Singer Song::Artist\n"
         + "copy 1 File::Name Song::Title\n"
         + "copy 2 WaveFile::Complexity Song::DynamicComplexity\n"
         + "",
         script,
     )
     self.assertEquals(["source1", "source2"], sourceIds)
 def testAggregatorScriptBuilding_severalSources(self):
     provider = MetadataSourceAggregator(sources, map)
     (script, sourceIds) = provider._AggregatorScriptFor([
         "Song::Artist",
         "Song::Title",
         "Song::DynamicComplexity",
     ])
     self.assertEquals(
         "copy 1 File::Singer Song::Artist\n" +
         "copy 1 File::Name Song::Title\n" +
         "copy 2 WaveFile::Complexity Song::DynamicComplexity\n" + "",
         script)
     self.assertEquals(["source1", "source2"], sourceIds)
 def testAggregatorScriptBuilding_partialThirdSource(self):
     provider = MetadataSourceAggregator(sources, map)
     (script, sourceIds) = provider._AggregatorScriptFor(["Frame::Energy"])
     self.assertEquals("copy 1 Frame::SpectralEnergy Frame::Energy\n" + "", script)
     self.assertEquals(["source3"], sourceIds)
 def testAggregatorScriptBuilding_partialSecondSource(self):
     provider = MetadataSourceAggregator(sources, map)
     (script, sourceIds) = provider._AggregatorScriptFor(["Song::DynamicComplexity"])
     self.assertEquals("copy 1 WaveFile::Complexity Song::DynamicComplexity\n" + "", script)
     self.assertEquals(["source2"], sourceIds)
 def testAggregatorScriptBuilding_partialFirstSource(self):
     provider = MetadataSourceAggregator(sources, map)
     (script, sourceIds) = provider._AggregatorScriptFor(["Song::Artist"])
     self.assertEquals("copy 1 File::Singer Song::Artist\n" + "", script)
     self.assertEquals(["source1"], sourceIds)
 def testAggregatorScriptBuilding_partialThirdSource(self):
     provider = MetadataSourceAggregator(sources, map)
     (script, sourceIds) = provider._AggregatorScriptFor(["Frame::Energy"])
     self.assertEquals("copy 1 Frame::SpectralEnergy Frame::Energy\n" + "",
                       script)
     self.assertEquals(["source3"], sourceIds)
 def testAggregatorScriptBuilding_partialFirstSource(self):
     provider = MetadataSourceAggregator(sources, map)
     (script, sourceIds) = provider._AggregatorScriptFor(["Song::Artist"])
     self.assertEquals("copy 1 File::Singer Song::Artist\n" + "", script)
     self.assertEquals(["source1"], sourceIds)