예제 #1
0
    def testBindLibrary(self):
        """
		This method tests :meth:`foundations.library.Library.bindLibrary` method.
		"""

        for name, path in LIBRARIES.iteritems():
            library = Library(path, bindLibrary=False)
            library.functions = LIBRARIES_FUNCTIONS[name]
            library.bindLibrary()
            for function in LIBRARIES_FUNCTIONS[name]:
                self.assertTrue(hasattr(library, function.name))
예제 #2
0
    def testBindLibrary(self):
        """
		This method tests :meth:`foundations.library.Library.bindLibrary` method.
		"""

        for name, path in LIBRARIES.iteritems():
            library = Library(path, bindLibrary=False)
            library.functions = LIBRARIES_FUNCTIONS[name]
            library.bindLibrary()
            for function in LIBRARIES_FUNCTIONS[name]:
                self.assertTrue(hasattr(library, function.name))
예제 #3
0
    def testBindFunction(self):
        """
		This method tests :meth:`foundations.library.Library.bindFunction` method.
		"""

        for name, path in LIBRARIES.iteritems():
            library = Library(path)
            library.functions = LIBRARIES_FUNCTIONS[name]
            for function in LIBRARIES_FUNCTIONS[name]:
                hasattr(library, function.name) and delattr(library, function.name)
                library.bindFunction(function)
                self.assertTrue(hasattr(library, function.name))
예제 #4
0
	def testBindFunction(self):
		"""
		Tests :meth:`foundations.library.Library.bindFunction` method.
		"""

		for name, path in LIBRARIES.iteritems():
			library = Library(path)
			library.functions = LIBRARIES_FUNCTIONS[name]
			for function in LIBRARIES_FUNCTIONS[name]:
				hasattr(library, function.name) and delattr(library, function.name)
				library.bindFunction(function)
				self.assertTrue(hasattr(library, function.name))
예제 #5
0
    def testLibrary(self):
        """
		This method tests :class:`foundations.library.Library` class binding.
		"""

        for name, path in LIBRARIES.iteritems():
            library = Library(path, LIBRARIES_FUNCTIONS[name])
            for function, value in LIBRARIES_TESTS_CASES[name].iteritems():
                self.assertEqual(getattr(library, function)(), value)