Ejemplo n.º 1
0
class TSPCFile(TestCase):
    def setUp(self):
        self.song = SPCFile(os.path.join(DATA_DIR, 'test.spc'))

    def test_tags(self):
        tags = {
            "title": "Game Select",
            "artist": "Koji Kondo",
            "album": "Super Mario All-Stars",
            "dumper": "Datschge",
        }

        for k, v in tags.items():
            self.failUnlessEqual(self.song[k], v)

    def test_length(self):
        self.failUnlessEqual(self.song("~#length"), 25)

    def test_write(self):
        self.song.write()

    def test_can_change(self):
        self.failUnless(self.song.can_change("title"))

    def test_invalid(self):
        path = os.path.join(DATA_DIR, 'empty.xm')
        self.failUnless(os.path.exists(path))
        self.failUnlessRaises(Exception, SPCFile, path)
Ejemplo n.º 2
0
class TSPCFile(TestCase):
    def setUp(self):
        self.song = SPCFile(get_data_path('test.spc'))

    def test_tags(self):
        tags = {
            "title": "Game Select",
            "artist": "Koji Kondo",
            "album": "Super Mario All-Stars",
            "dumper": "Datschge",
        }

        for k, v in tags.items():
            self.failUnlessEqual(self.song[k], v)

    def test_length(self):
        self.failUnlessEqual(self.song("~#length"), 25)

    def test_write(self):
        self.song.write()

    def test_can_change(self):
        self.failUnless(self.song.can_change("title"))

    def test_invalid(self):
        path = get_data_path('empty.xm')
        self.failUnless(os.path.exists(path))
        self.failUnlessRaises(Exception, SPCFile, path)

    def test_format_codec(self):
        self.assertEqual(self.song("~format"), "SPC700")
        self.assertEqual(self.song("~codec"), "SPC700")
        self.assertEqual(self.song("~encoding"), "")
Ejemplo n.º 3
0
class TSPCFile(TestCase):
    def setUp(self):
        self.song = SPCFile(get_data_path('test.spc'))

    def test_tags(self):
        tags = {
            "title": "Game Select",
            "artist": "Koji Kondo",
            "album": "Super Mario All-Stars",
            "dumper": "Datschge",
        }

        for k, v in tags.items():
            self.failUnlessEqual(self.song[k], v)

    def test_length(self):
        self.failUnlessEqual(self.song("~#length"), 25)

    def test_write(self):
        self.song.write()

    def test_can_change(self):
        self.failUnless(self.song.can_change("title"))

    def test_invalid(self):
        path = get_data_path('empty.xm')
        self.failUnless(os.path.exists(path))
        self.failUnlessRaises(Exception, SPCFile, path)

    def test_format_codec(self):
        self.assertEqual(self.song("~format"), "SPC700")
        self.assertEqual(self.song("~codec"), "SPC700")
        self.assertEqual(self.song("~encoding"), "")
Ejemplo n.º 4
0
 def setUp(self):
     self.song = SPCFile(os.path.join(DATA_DIR, 'test.spc'))
Ejemplo n.º 5
0
 def setUp(self):
     self.song = SPCFile(get_data_path('test.spc'))
Ejemplo n.º 6
0
 def setUp(self):
     self.song = SPCFile(get_data_path('test.spc'))