import unittest
import path
import sys
from cStringIO import StringIO

from pynto import chelpers

class TestLookupLibrary (unittest.TestCase):

    """ The main point of these tests is to ensure libwrapper doesn't
    crash or do anything stupid """

    def testValid (self):

        """ Tests that the function doesn't die on a valid lookup! """

        chelpers.lookup_library ("Pynto_ErrFetch")
        return

    def testInvalid (self):

        """ Tests that the function does die on a invalid lookup! """

        self.assertRaises (ValueError,
                           chelpers.lookup_library,
                           "Pynto_ErrFelch")
        return

    pass

def add_tests (suite):
    for testname in dir (TestLookupLibrary):
        if testname.startswith ('test'):
            suite.addTest (TestLookupLibrary(testname))
            pass
        pass
    return

if __name__ == "__main__":
    
    unittest.main ()
    pass

