Exemplo n.º 1
0
def test_function_pretty_signature():
    """Test building the pretty signature of a function.

    """
    library = CLibrary(os.path.basename(_ctypes_test.__file__),
                       ['ctypes_test.h'])
    library.my_strdup.pretty_signature()
Exemplo n.º 2
0
 def setup(self):
     self.library = CLibrary(_ctypes_test.__file__, ['ctypes_test.h'])
Exemplo n.º 3
0
 def setup(self):
     path = os.path.join(os.path.dirname(__file__), 'test.pyclibcache')
     parser = CParser(['ctypes_test.h'])
     parser.write_cache(path)
     self.library = CLibrary(_ctypes_test.__file__, ['ctypes_test.h'],
                             cache=path)
Exemplo n.º 4
0
    def test_already_opened_library(self):

        lib = ctypes.CDLL(_ctypes_test.__file__)
        library = CLibrary(lib, ['ctypes_test.h'])
        assert library is CLibrary(_ctypes_test.__file__, ['ctypes_test.h'])
Exemplo n.º 5
0
    def test_accessing_library_by_object(self):

        lib = ctypes.CDLL(_ctypes_test.__file__)
        library = CLibrary(lib, ['ctypes_test.h'])
        assert library._lib_ is lib
Exemplo n.º 6
0
    def test_accessing_library_by_path(self):

        library = CLibrary(_ctypes_test.__file__, ['ctypes_test.h'])
        assert library._lib_
Exemplo n.º 7
0
    def test_accessing_library_by_name(self, library_location_fixture):

        library = CLibrary(os.path.basename(_ctypes_test.__file__),
                           ['ctypes_test.h'])
        assert library._lib_