def testSetCTypesForLibraryLibNotFound(self, find_library_mock): find_library_mock.return_value = None with self.assertRaises(objc.ErrorLibNotFound): objc.SetCTypesForLibrary("mock", self.cftable) # Check that hte first argument of the first find_library call is "mock". find_library_mock.assert_called_with("mock")
def testSetCTypesForLibrary(self, load_library_mock, find_library_mock): mock_dll = mock.MagicMock() find_library_mock.return_value = "/mock/path" load_library_mock.return_value = mock_dll dll = objc.SetCTypesForLibrary("mock", self.cftable) find_library_mock.assert_called_with("mock") self.assertEqual(dll.CFMockFunc.argtypes, self.argtypes) self.assertEqual(dll.CFMockFunc.restype, self.restype)