'test that windows filenames are handled appropriately by Template.'

def test_windows_paths(self):

    current_path = os.path
    import ntpath
    os.path = ntpath
    try:
        class NoCompileTemplate(Template, ):
            def _compile_from_file(self, path, filename):
                self.path = path
                return Template('foo    bar').module
        t1 = NoCompileTemplate(filename='c:\\foo\\template.html', module_directory='c:\\modules\\')
        eq_(t1.uri, '/foo/template.html')
        eq_(t1.path, 'c:\\modules\\foo\\template.html.py')
        t1 = NoCompileTemplate(filename='c:\\path\\to\\templates\\template.html', uri='/bar/template.html', module_directory='c:\\modules\\')
        eq_(t1.uri, '/bar/template.html')
        eq_(t1.path, 'c:\\modules\\bar\\template.html.py')
    finally:
        os.path = current_path
