Beispiel #1
0
    def test_setTitle(self):
        expected = "Title"
        audio = mp3Tagger.filterMP3(mp3Tagger.readDirectory("exampleData"))[1]
        mp3Tagger.setTitle("exampleData/" + audio, "Title")

        actual = mp3Tagger.getTitle("exampleData/" + audio)
        self.assertEqual(expected, actual)
Beispiel #2
0
 def test_filterMP3(self):
     expected = [
         "testFile - testFileForGetter - audioSample - comment.mp3",
         "testFile - testFileForSetter - audioSample - comment.mp3"
     ]
     actual = mp3Tagger.filterMP3(mp3Tagger.readDirectory("exampleData"))
     self.assertEqual(expected, actual)
Beispiel #3
0
 def test_readDirectorySucceeds(self):
     expected = [
         "folder.png",
         "testFile - testFileForGetter - audioSample - comment.mp3",
         "testFile - testFileForSetter - audioSample - comment.mp3"
     ]
     actual = mp3Tagger.readDirectory("exampleData")
     self.assertEqual(expected, actual)
Beispiel #4
0
    def setUp(self):
        audios = mp3Tagger.filterMP3(mp3Tagger.readDirectory("exampleData"))

        mp3Tagger.setTitle("exampleData/" + audios[0], "testFileForGetter")
        mp3Tagger.setArtist("exampleData/" + audios[0], "testFile")
        mp3Tagger.setAlbum("exampleData/" + audios[0], "audioSample")
        mp3Tagger.setTrack("exampleData/" + audios[0], "01")
        mp3Tagger.setYear("exampleData/" + audios[0], "2017")
        mp3Tagger.setGenre("exampleData/" + audios[0], "sample")
        mp3Tagger.setComment("exampleData/" + audios[0], "comment")

        mp3Tagger.setTitle("exampleData/" + audios[1], "testFileForSetter")
        mp3Tagger.setArtist("exampleData/" + audios[1], "testFile")
        mp3Tagger.setAlbum("exampleData/" + audios[1], "audioSample")
        mp3Tagger.setTrack("exampleData/" + audios[1], "02")
        mp3Tagger.setYear("exampleData/" + audios[1], "2017")
        mp3Tagger.setGenre("exampleData/" + audios[1], "sample")
        mp3Tagger.setComment("exampleData/" + audios[1], "comment")
Beispiel #5
0
 def test_getComment(self):
     expected = "comment"
     actual = mp3Tagger.readDirectory("exampleData")
     actual = mp3Tagger.filterMP3(actual)
     actual = mp3Tagger.getComment("exampleData/" + actual[0])
     self.assertEqual(expected, actual)
Beispiel #6
0
 def test_getYear(self):
     expected = "2017"
     actual = mp3Tagger.readDirectory("exampleData")
     actual = mp3Tagger.filterMP3(actual)
     actual = mp3Tagger.getYear("exampleData/" + actual[0])
     self.assertEqual(expected, str(actual))
Beispiel #7
0
 def test_getAlbum(self):
     expected = "audioSample"
     actual = mp3Tagger.readDirectory("exampleData")
     actual = mp3Tagger.filterMP3(actual)
     actual = mp3Tagger.getAlbum("exampleData/" + actual[0])
     self.assertEqual(expected, actual)
Beispiel #8
0
 def test_getTitle(self):
     expected = "testFileForGetter"
     actual = mp3Tagger.readDirectory("exampleData")
     actual = mp3Tagger.filterMP3(actual)
     actual = mp3Tagger.getTitle("exampleData/" + actual[0])
     self.assertEqual(expected, actual)
Beispiel #9
0
 def test_readDirectoryFails(self):
     expected = []
     actual = mp3Tagger.readDirectory("exampleData")
     self.assertNotEqual(expected, actual)
Beispiel #10
0
 def test_setYear(self):
     expected = "1000"
     audio = mp3Tagger.filterMP3(mp3Tagger.readDirectory("exampleData"))[1]
     mp3Tagger.setYear("exampleData/" + audio, "1000")
     actual = mp3Tagger.getYear("exampleData/" + audio)
     self.assertEqual(expected, str(actual))