Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduced fixed certificates for tests #51

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dw-kihara
Copy link

I discovered the tests were failing because the tests check the contents of certificates, which changes frequently.
To address this, I introduced cacerts_test_data/0 which returns the fixed certificates for testing.

Although cacerts/0 could return the fixed certificats during tests,
I kept it to return the content of priv/cacerts.pem to ensure it provides the correct certificates.

I also modified certifi_pt.erl to transform both functions and to make Dialyzer happy.

Comment on lines +5 to +6
%% Update this when updating priv/cacerts.pem.
-define(NUM_OF_CERTS, 147).
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initially, I thought this number could be generated by parsing priv/cacerts.pem.
However, I realized this approach would weaken the test because parsing the file to verify it is properly parsed sounds somewhat circular.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant