<commit_before>-module (notes_openid_test).

-include_lib ("nitrogen_core/include/wf.hrl").

-include ("notes_test.hrl").
-include ("notes_data.hrl").

-compile (export_all).

-define (MOCK_MODULES, [
	notes_test_server_target ]).

-define (TARGET,
	notes_openid).

prepare_test () ->

	{ ok, Server } =
		notes_test_server:start_link (
			openid,
			notes_test_server_target),

	?EXPECT,

		em:strict (Em, notes_test_server_target, handle_call,

			[	{	prepare,
					"session id",
					"open id url",
					true },
				em:any () ],

			{ return, ok }),

	?REPLAY,

		?assertEqual (

			ok,

			?TARGET:prepare (
				"session id",
				"open id url",
				true)),

	?VERIFY,

	ok = notes_test_server:stop (Server).<commit_msg>improve eunit coverage<commit_after>-module (notes_openid_test).

-include_lib ("nitrogen_core/include/wf.hrl").

-include ("notes_test.hrl").
-include ("notes_data.hrl").

-compile (export_all).

-define (MOCK_MODULES, [
	notes_test_server_target ]).

-define (TARGET,
	notes_openid).

prepare_test () ->

	{ ok, Server } =
		notes_test_server:start_link (
			openid,
			notes_test_server_target),

	?EXPECT,

		em:strict (Em, notes_test_server_target, handle_call,

			[	{	prepare,
					"session id",
					"open id url",
					true },
				em:any () ],

			{ return, ok }),

	?REPLAY,

		?assertEqual (

			ok,

			?TARGET:prepare (
				"session id",
				"open id url",
				true)),

	?VERIFY,

	ok = notes_test_server:stop (Server).

verify_test () ->

	Params = [
		{ "param key", "param value" }
	],

	{ ok, Server } =
		notes_test_server:start_link (
			openid,
			notes_test_server_target),

	?EXPECT,

		em:strict (Em, notes_test_server_target, handle_call,

			[	{	verify,
					"session id",
					"return to",
					Params },
				em:any () ],

			{ return, ok }),

	?REPLAY,

		?assertEqual (

			ok,

			?TARGET:verify (
				"session id",
				"return to",
				Params)),

	?VERIFY,

	ok = notes_test_server:stop (Server).
{'fraction_non_alphanumeric': 0.15289892252437148, 'fraction_numerical': 0.0, 'mean_word_length': 3.088050314465409, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4988599', 'n_tokens_mistral': 885, 'n_tokens_neox': 734, 'n_words': 141}