"""
$URL: svn+ssh://svn.mems-exchange.org/repos/trunk/dulcinea/lib/ui/test/utest_directory.py $
$Id: utest_directory.py 29354 2007-02-09 22:26:41Z dbinger $
"""
from qp.fill.directory import Directory
from sancho.utest import UTest


class DirectoryTest (UTest):

    def b(self):
        class Dir (Directory):
            def get_exports(self):
                return []
        return Dir()._q_translate('') is None

    def c(self):
        class Dir (Directory):
            def get_exports(self):
                return [('')]
        try:
            Dir()._q_translate('') is None
            assert 0
        except ValueError:
            pass

    def d(self):
        class Dir (Directory):
            def get_exports(self):
                return [('', '_q_index', 'crumb', 'title')]
        assert Dir()._q_translate('') == '_q_index'

if __name__ == "__main__":
    DirectoryTest()
