from __future__ import print_function
import os, sys
-
-try:
- import unittest2 as unittest
-except ImportError:
- import unittest
+import unittest
def main():
# Eli Bendersky (eliben@gmail.com)
# This code is in the public domain
#-------------------------------------------------------------------------------
-try:
- import unittest2 as unittest
-except ImportError:
- import unittest
+import unittest
import os
-from utils import setup_syspath; setup_syspath()
from elftools.elf.elffile import ELFFile
# Eli Bendersky (eliben@gmail.com)
# This code is in the public domain
#-------------------------------------------------------------------------------
-try:
- import unittest2 as unittest
-except ImportError:
- import unittest
+import unittest
-from utils import setup_syspath; setup_syspath()
from elftools.common.py3compat import BytesIO
from elftools.dwarf.callframe import (
CallFrameInfo, CIE, FDE, instruction_name, CallFrameInstruction,
# Yann Rouillard (yann@pleiades.fr.eu.org)
# This code is in the public domain
#------------------------------------------------------------------------------
-try:
- import unittest2 as unittest
-except ImportError:
- import unittest
+import unittest
import os
-from utils import setup_syspath; setup_syspath()
from elftools.elf.elffile import ELFFile
from elftools.elf.dynamic import DynamicSection, DynamicTag
# Eli Bendersky (eliben@gmail.com)
# This code is in the public domain
#-------------------------------------------------------------------------------
-try:
- import unittest2 as unittest
-except ImportError:
- import unittest
+import unittest
-from utils import setup_syspath; setup_syspath()
from elftools.dwarf.descriptions import ExprDumper, set_global_machine_arch
from elftools.dwarf.structs import DWARFStructs
# Eli Bendersky (eliben@gmail.com)
# This code is in the public domain
#-------------------------------------------------------------------------------
-try:
- import unittest2 as unittest
-except ImportError:
- import unittest
+import unittest
-from utils import setup_syspath; setup_syspath()
from elftools.common.py3compat import BytesIO, iteritems
from elftools.dwarf.lineprogram import LineProgram, LineState, LineProgramEntry
from elftools.dwarf.structs import DWARFStructs
# Eli Bendersky (eliben@gmail.com), Santhosh Kumar Mani (santhoshmani@gmail.com)
# This code is in the public domain
#-------------------------------------------------------------------------------
-try:
- import unittest2 as unittest
-except ImportError:
- import unittest
import os
+import unittest
-from utils import setup_syspath; setup_syspath()
from elftools.elf.elffile import ELFFile
class TestRangeLists(unittest.TestCase):
# Eli Bendersky (eliben@gmail.com)
# This code is in the public domain
#-------------------------------------------------------------------------------
-try:
- import unittest2 as unittest
-except ImportError:
- import unittest
+import unittest
-from utils import setup_syspath; setup_syspath()
from elftools.dwarf.structs import DWARFStructs
# Eli Bendersky (eliben@gmail.com)
# This code is in the public domain
#-------------------------------------------------------------------------------
-try:
- import unittest2 as unittest
-except ImportError:
- import unittest
+import unittest
import os
-from utils import setup_syspath
-setup_syspath()
from elftools.elf.elffile import ELFFile
from elftools.common.exceptions import ELFError
from elftools.elf.dynamic import DynamicTag
# Eli Bendersky (eliben@gmail.com)
# This code is in the public domain
#-------------------------------------------------------------------------------
-try:
- import unittest2 as unittest
-except ImportError:
- import unittest
+import unittest
-from utils import setup_syspath; setup_syspath()
from elftools.elf.elffile import ELFFile
-# Tests the functionality of the ELF file function `get_symbol_by_name`.
-
-try:
- import unittest2 as unittest
-except ImportError:
- import unittest
+#-------------------------------------------------------------------------------
+# Tests the functionality of get_symbol_by_name
+#
+# Eli Bendersky (eliben@gmail.com)
+# This code is in the public domain
+#-------------------------------------------------------------------------------
+import unittest
import os
-from utils import setup_syspath; setup_syspath()
from elftools.elf.elffile import ELFFile
+
class TestGetSymbolByName(unittest.TestCase):
def test_existing_symbol(self):
with open(os.path.join('test', 'testfiles_for_unittests',
# Yann Rouillard (yann@pleiades.fr.eu.org)
# This code is in the public domain
#------------------------------------------------------------------------------
-try:
- import unittest2 as unittest
-except ImportError:
- import unittest
+import unittest
import os
-from utils import setup_syspath
-setup_syspath()
from elftools.elf.elffile import ELFFile
from elftools.elf.constants import VER_FLAGS
from elftools.elf.gnuversions import (
# Karl Vogel (karl.vogel@gmail.com)
# This code is in the public domain
#-------------------------------------------------------------------------------
-try:
- import unittest2 as unittest
-except ImportError:
- import unittest
+import unittest
import os
-from utils import setup_syspath; setup_syspath()
from elftools.elf.elffile import ELFFile
class TestMIPSSupport(unittest.TestCase):
if __name__ == '__main__':
unittest.main()
-
# Yann Rouillard (yann@pleiades.fr.eu.org)
# This code is in the public domain
#-------------------------------------------------------------------------------
-try:
- import unittest2 as unittest
-except ImportError:
- import unittest
+import unittest
import os
import copy
-from utils import setup_syspath; setup_syspath()
from elftools.elf.elffile import ELFFile
from elftools.elf.constants import SUNW_SYMINFO_FLAGS
# Eli Bendersky (eliben@gmail.com)
# This code is in the public domain
#-------------------------------------------------------------------------------
-try:
- import unittest2 as unittest
-except ImportError:
- import unittest
+import unittest
import os
-from utils import setup_syspath; setup_syspath()
from elftools.elf.elffile import ELFFile
from elftools.elf.sections import StabSection
# Eli Bendersky (eliben@gmail.com)
# This code is in the public domain
#-------------------------------------------------------------------------------
-try:
- import unittest2 as unittest
-except ImportError:
- import unittest
+import unittest
from random import randint
-from utils import setup_syspath; setup_syspath()
from elftools.common.py3compat import int2byte, BytesIO
from elftools.common.utils import (parse_cstring_from_stream,
preserve_stream_pos)