def test_inputs(self):
        # Language repacks take updated resources from an ap_ and pack them
        # into an apk.  In this case, the first input is the original package,
        # the second input the update ap_.  Make sure the second input
        # overrides the first.
        jarrer = package(inputs=[data('input2.apk'), data('input1.ap_')])

        files1 = JarReader(data('input1.ap_')).entries.keys()
        files2 = JarReader(data('input2.apk')).entries.keys()
        for name in files2:
            self.assertTrue(name in files1 or
                            jarrer[name].open().read().startswith('input2/'))
        for name in files1:
            self.assertTrue(jarrer[name].open().read().startswith('input1/'))
Exemple #2
0
    def test_arguments(self):
        # Language repacks take updated resources from an ap_ and pack them
        # into an apk.  Make sure the second input overrides the first.
        jarrer = package(inputs=[],
                         omni_ja=data('omni.ja'),
                         assets_dirs=[data('assets')],
                         lib_dirs=[data('lib')],
                         root_files=[data('root_file.txt')])

        # omni.ja ends up in assets/omni.ja.
        self.assertEquals(jarrer['assets/omni.ja'].open().read().strip(),
                          'omni.ja')

        # Everything else is in place.
        for name in ('assets/asset.txt', 'lib/lib.txt', 'root_file.txt'):
            self.assertEquals(jarrer[name].open().read().strip(), name)
    def test_arguments(self):
        # Language repacks take updated resources from an ap_ and pack them
        # into an apk.  Make sure the second input overrides the first.
        jarrer = package(inputs=[],
                         omni_ja=data('omni.ja'),
                         classes_dex=data('classes.dex'),
                         assets_dirs=[data('assets')],
                         lib_dirs=[data('lib')],
                         root_files=[data('root_file.txt')])

        # omni.ja ends up in assets/omni.ja.
        self.assertEquals(jarrer['assets/omni.ja'].open().read().strip(), 'omni.ja')

        # Everything else is in place.
        for name in ('classes.dex',
                     'assets/asset.txt',
                     'lib/lib.txt',
                     'root_file.txt'):
            self.assertEquals(jarrer[name].open().read().strip(), name)