# Path: androguard/cli/entry_points.py
# def entry_point(verbosity):
# def axml(input_, output, file_, resource):
# def arsc(input_,
#          file_,
#          output,
#          package,
#          locale,
#          type_,
#          id_,
#          list_packages,
#          list_locales,
#          list_types):
# def cg(output,
#        show,
#        verbose,
#        classname,
#        methodname,
#        descriptor,
#        accessflag,
#        no_isolated,
#        apk):
# def decompile(input_, file_, output, format_, jar, limit, decompiler):
# def sign(hash_, print_all_hashes, show, apk):
# def apkid(apks):
# def gui(input_file, input_plugin):
# def analyze(session, apk):
# def disassemble(offset, size, dex):


from pkg_resources import resource_filename
from tempfile import mkstemp, mkdtemp
from click.testing import CliRunner
from androguard.cli import entry_points
import os
import shutil
import unittest
    def test_decompile_basic_input(self):
        runner = CliRunner()
        apk_path = resource_filename('androguard',
                                     '../examples/dalvik/test/bin/'
                                     'Test-debug.apk')
        output_dir = mkdtemp(prefix='androguard_test_')
        result = runner.invoke(entry_points.entry_point,
                               ['decompile', '-i', apk_path, '-o', output_dir])
        assert result.exit_code == 0
        # Cleanup:
        if os.path.exists(output_dir) and os.path.isdir(output_dir):
            shutil.rmtree(output_dir)

    def test_decompile_error_two_arguments(self):
        runner = CliRunner()
        apk_path = resource_filename('androguard',
                                     '../examples/dalvik/test/bin/'
                                     'Test-debug.apk')
        output_dir = mkdtemp(prefix='androguard_test_')
        arguments = ['decompile', '-i', apk_path, apk_path, '-o', output_dir]
        result = runner.invoke(entry_points.entry_point, arguments)
        assert result.exit_code == 1, arguments
        # Cleanup:
        if os.path.exists(output_dir) and os.path.isdir(output_dir):
            shutil.rmtree(output_dir)

    def test_decompile_error_no_arguments(self):
        runner = CliRunner()
        output_dir = mkdtemp(prefix='androguard_test_')
        arguments = ['decompile', '-o', output_dir]

# Path: androguard/cli/entry_points.py
# def entry_point(verbosity):
# def axml(input_, output, file_, resource):
# def arsc(input_,
#          file_,
#          output,
#          package,
#          locale,
#          type_,
#          id_,
#          list_packages,
#          list_locales,
#          list_types):
# def cg(output,
#        show,
#        verbose,
#        classname,
#        methodname,
#        descriptor,
#        accessflag,
#        no_isolated,
#        apk):
# def decompile(input_, file_, output, format_, jar, limit, decompiler):
# def sign(hash_, print_all_hashes, show, apk):
# def apkid(apks):
# def gui(input_file, input_plugin):
# def analyze(session, apk):
# def disassemble(offset, size, dex):


# Path: tests/test_entry_points.py
from pkg_resources import resource_filename
from tempfile import mkstemp, mkdtemp
from click.testing import CliRunner
from androguard.cli import entry_points
import os
import shutil
import unittest

    def test_decompile_basic_input(self):
        runner = CliRunner()
        apk_path = resource_filename('androguard',
                                     '../examples/dalvik/test/bin/'
                                     'Test-debug.apk')
        output_dir = mkdtemp(prefix='androguard_test_')
        result = runner.invoke(entry_points.entry_point,
                               ['decompile', '-i', apk_path, '-o', output_dir])
        assert result.exit_code == 0
        # Cleanup:
        if os.path.exists(output_dir) and os.path.isdir(output_dir):
            shutil.rmtree(output_dir)

    def test_decompile_error_two_arguments(self):
        runner = CliRunner()
        apk_path = resource_filename('androguard',
                                     '../examples/dalvik/test/bin/'
                                     'Test-debug.apk')
        output_dir = mkdtemp(prefix='androguard_test_')
        arguments = ['decompile', '-i', apk_path, apk_path, '-o', output_dir]
        result = runner.invoke(entry_points.entry_point, arguments)
        assert result.exit_code == 1, arguments
        # Cleanup:
        if os.path.exists(output_dir) and os.path.isdir(output_dir):
            shutil.rmtree(output_dir)

    def test_decompile_error_no_arguments(self):
        runner = CliRunner()
        output_dir = mkdtemp(prefix='androguard_test_')
        arguments = ['decompile', '-o', output_dir]

        result = runner.invoke(entry_points.entry_point, arguments)