def _setBoundTest(self, which):
certificate = X509()<EOL>set = getattr(certificate, '<STR_LIT>' + which)<EOL>get = getattr(certificate, '<STR_LIT>' + which)<EOL>assert get() is None<EOL>when = b"<STR_LIT>"<EOL>set(when)<EOL>assert get() == when<EOL>when = b"<STR_LIT>"<EOL>set(when)<EOL>assert get() == when<EOL>when = b"<STR_LIT>"<EOL>set(when)<EOL>assert get() == when<EOL>with pytest.raises(ValueError):<EOL><INDENT>set(b"<STR_LIT>")<EOL><DEDENT>with pytest.raises(TypeError):<EOL><INDENT>set()<EOL><DEDENT>with pytest.raises(TypeError):<EOL><INDENT>set(b"<STR_LIT>", b"<STR_LIT>")<EOL><DEDENT>with pytest.raises(TypeError):<EOL><INDENT>get(b"<STR_LIT>")<EOL><DEDENT>
`X509.set_notBefore` takes a string in the format of an
ASN1 GENERALIZEDTIME and sets the beginning of the certificate's
validity period to it.