This the email. It is in HTML and I am trying to retrieve the code
I just put an assertion just to check if I am getting the body of the email but the error says it's ''
Emails typically have two parts, an html part and a text part. This is so that when you are reading an email on a device that doesn't support html (rare these days) the text version can be shown.
To answer your question: you need to change your code to use email.html.body rather than email.text.body as you don't have a text version of your email.
You should be able to retrieve your authentication code via email.html.codes[0] as well.