How do I test that I decoded a b64 string into a PDF?

I am about to write a functionality in which I will be handling a base-64-encoded string that represents a PDF file, and then decode it and save it somewhere. I have a pretty good idea about how to implement this, but the problem is that I'm finding it really hard to test.

I guess I would need to write something like (using unittest):

from unittest import TestCase

from mymodule import decode_pdf


class MyTestCase(TestCase):
    def test_decode_pdf_decodes_file_successfully(self):
        b64_encoded_string = '...'    # I would need to find some valid b64-encoded string somewhere
        pdf_file = decode_pdf(b64_encoded_string)    # This could return a file-like object, like BytesIO
        self.assertIn(b'PDF', next(pdf_file))    # I know the first lines of PDF files are something like b"%PDF-1.4"

But I don't know, does it even make sense? Am I testing the behavior that matters?

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum