'Ensure that <expected> is substituted properly for <var> in strings
containing <var> in various positions.'

def check_canonical(self, var, expected):

    path = '/foo/bar/baz'
    self.assertEqual(canonicalize_path((var + path)), (expected + path))
    self.assertEqual(canonicalize_path((path + var)), ((path + '/') + expected))
    self.assertEqual(canonicalize_path(((path + var) + path)), (expected + path))
