Exemple #1
0
 def test_import_chr(self):
     try:
         os.remove('/tmp/mario.chr')
     except:
         pass
     self.assertFileNotExists('/tmp/mario.chr')
     image.import_chr('fixtures/mario.png', '/tmp/mario.chr')
     self.assertFileExists('/tmp/mario.chr')
     self.assertCHRFileEquals('fixtures/nesasm/scrolling/mario.chr',
                              '/tmp/mario.chr')
     os.remove('/tmp/mario.chr')
Exemple #2
0
 def test_import_chr(self):
     try:
         os.remove('/tmp/mario.chr')
     except:
         pass
     self.assertFileNotExists('/tmp/mario.chr')
     image.import_chr('fixtures/mario.png', '/tmp/mario.chr')
     self.assertFileExists('/tmp/mario.chr')
     self.assertCHRFileEquals(
         'fixtures/nerdynights/scrolling/mario.chr',
         '/tmp/mario.chr')
     os.remove('/tmp/mario.chr')
Exemple #3
0
    def test_import_chr(self):
        try:
            os.remove('/tmp/mario.chr')
        except:
            pass
        self.assertFalse(os.path.exists('/tmp/mario.chr'))
        image.import_chr('fixtures/mario.png', '/tmp/mario.chr')
        self.assertTrue(os.path.exists('/tmp/mario.chr'))

        expected = open('fixtures/nesasm/scrolling/mario.chr', 'rb').read()
        actual = open('/tmp/mario.chr', 'rb').read()
        self.assertEquals(expected, actual)

        os.remove('/tmp/mario.chr')