def METHOD_NAME(self):
    foobarbaz = self.SEP.join(("foo", "bar", "baz"))
    self.assertEqual(basedir(foobarbaz, ["foo", "bar", "baz"]), "foo")
    self.assertEqual(basedir(foobarbaz, ["foo", "foo/bar", "baz"]), "foo/bar")
    self.assertEqual(basedir(foobarbaz, ["foo/bar", "foo", "baz"]), "foo/bar")
    self.assertEqual(basedir(foobarbaz, ["foo", "bar", ""]), "foo")
    self.assertEqual(basedir(foobarbaz, ["bar", "baz", ""]), "")