Ejemplo n.º 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))
Ejemplo n.º 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))
Ejemplo n.º 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))
Ejemplo n.º 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))
Ejemplo n.º 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)