def METHOD_NAME(self, user_id, password, no_salt, capsys):
    args = "db password"
    if user_id:
        args += " --user-id=%s " % user_id
    if no_salt:
        args += " %s" % no_salt
    if password:
        args += " %s" % password
    else:
        self.expectPassword("ome", id=user_id)
        self.expectConfirmation("ome", id=user_id)
        self.mox.ReplayAll()
    self.cli.invoke(args, strict=True)
    self.password(args)
    out, err = capsys.readouterr()
    assert out.strip() == self.password_output(user_id, no_salt)