'Check that the C{resolve} method of alias processors produce the correct
set of objects:
- direct alias with L{mail.alias.AddressAlias} if a simple input is passed
- aliases in a file with L{mail.alias.FileWrapper} if an input in the format
\'/file\' is given
- aliases resulting of a process call wrapped by L{mail.alias.MessageWrapper}
if the format is \'|process\''

def test_aliasResolution(self):

    aliases = {}
    domain = {'': TestDomain(aliases, ['user1', 'user2', 'user3'])}
    A1 = MockAliasGroup(['user1', '|echo', '/file'], domain, 'alias1')
    A2 = MockAliasGroup(['user2', 'user3'], domain, 'alias2')
    A3 = mail.alias.AddressAlias('alias1', domain, 'alias3')
    aliases.update({'alias1': A1, 'alias2': A2, 'alias3': A3})
    res1 = A1.resolve(aliases)
    r1 = map(str, res1.objs)
    r1.sort()
    expected = map(str, [mail.alias.AddressAlias('user1', None, None), mail.alias.MessageWrapper(DummyProcess(), 'echo'), mail.alias.FileWrapper('/file')])
    expected.sort()
    self.assertEqual(r1, expected)
    res2 = A2.resolve(aliases)
    r2 = map(str, res2.objs)
    r2.sort()
    expected = map(str, [mail.alias.AddressAlias('user2', None, None), mail.alias.AddressAlias('user3', None, None)])
    expected.sort()
    self.assertEqual(r2, expected)
    res3 = A3.resolve(aliases)
    r3 = map(str, res3.objs)
    r3.sort()
    expected = map(str, [mail.alias.AddressAlias('user1', None, None), mail.alias.MessageWrapper(DummyProcess(), 'echo'), mail.alias.FileWrapper('/file')])
    expected.sort()
    self.assertEqual(r3, expected)
