def other_headers(alg, key):
@Vows.batch<EOL>class OtherHeaders(Vows.Context):<EOL><INDENT>"""<STR_LIT>"""<EOL>def topic(self):<EOL><INDENT>"""<STR_LIT>"""<EOL>return jwt.generate_jwt(payload, key, alg, timedelta(seconds=<NUM_LIT>),<EOL>other_headers={'<STR_LIT>': '<STR_LIT>'})<EOL><DEDENT>class Verify(Vows.Context):<EOL><INDENT>"""<STR_LIT>"""<EOL>def topic(self, topic):<EOL><INDENT>"""<STR_LIT>"""<EOL>return jwt.verify_jwt(topic, key, [alg])<EOL><DEDENT>def token_should_verify_with_extra_header(self, r):<EOL><INDENT>"""<STR_LIT>"""<EOL>expect(r).to_be_instance_of(tuple)<EOL>header, _ = r<EOL>expect(header).to_equal({<EOL>u'<STR_LIT>': alg,<EOL>u'<STR_LIT>': u'<STR_LIT>',<EOL>u'<STR_LIT>': u'<STR_LIT>'<EOL>})<EOL><DEDENT><DEDENT><DEDENT>@Vows.batch<EOL>class RedefinedTypHeader(Vows.Context):<EOL><INDENT>"""<STR_LIT>"""<EOL>@Vows.capture_error<EOL>def topic(self):<EOL><INDENT>"""<STR_LIT>"""<EOL>return jwt.generate_jwt(payload, key, alg, timedelta(seconds=<NUM_LIT>),<EOL>other_headers={'<STR_LIT>': '<STR_LIT>'})<EOL><DEDENT>def should_not_generated_token(self, r):<EOL><INDENT>"""<STR_LIT>"""<EOL>expect(r).to_be_an_error()<EOL>expect(str(r)).to_equal("<STR_LIT>")<EOL><DEDENT><DEDENT>@Vows.batch<EOL>class RedefinedAlgHeader(Vows.Context):<EOL><INDENT>"""<STR_LIT>"""<EOL>@Vows.capture_error<EOL>def topic(self):<EOL><INDENT>"""<STR_LIT>"""<EOL>return jwt.generate_jwt(payload, key, alg, timedelta(seconds=<NUM_LIT>),<EOL>other_headers={'<STR_LIT>': '<STR_LIT>'})<EOL><DEDENT>def should_not_generated_token(self, r):<EOL><INDENT>"""<STR_LIT>"""<EOL>expect(r).to_be_an_error()<EOL>expect(str(r)).to_equal("<STR_LIT>")<EOL><DEDENT><DEDENT>
setup tests