'tryAuth() has two edge cases that are difficult to reach.
1) an authentication method auth_* returns None instead of a Deferred.
2) an authentication type that is defined does not have a matching
auth_* method.
Both these cases should return a Deferred which fails with a
ConchError.'

def test_tryAuthEdgeCases(self):

    def mockAuth(packet):
        return None
    self.patch(self.authServer, 'auth_publickey', mockAuth)
    self.patch(self.authServer, 'auth_password', None)
    def secondTest(ignored):
        d2 = self.authServer.tryAuth('password', None, None)
        return self.assertFailure(d2, ConchError)
    d1 = self.authServer.tryAuth('publickey', None, None)
    return self.assertFailure(d1, ConchError).addCallback(secondTest)
