How to test if a transaction can spend an existing output?
If you build Bitcoin Core from master, you can use the new testmempoolaccept rpc method to check if your tx would have made it into the mempool. This will include checking the signature, and ensuring that your inputs are actually unspent. It does not add broadcast the tx into the mempool, but simply checks if it would have been accepted.