'Test alias extraction'

def testAlias(self):

    p = S3URLQueryParser()
    assertEqual = self.assertEqual
    selectors = (('~.example$sub', None), ('other.example', 'other'), ('another', None), ('.no    prefix', None), ('test.~.~', 'test'))
    for (selector, expected) in selectors:
        alias = p._alias(FS(selector))
        assertEqual(alias, expected, msg=("Expected    '%s'    for    '%s',    but    got    '%s'" % (expected, selector, alias)))
    assertEqual(p._alias(None), None)
