<commit_before>import os.path
import unittest

from flashproxy.keys import PIN_GOOGLE_CERT, PIN_GOOGLE_PUBKEY_SHA1, DEFAULT_FACILITATOR_PUBKEY_PEM, check_certificate_pin, temp_cert

class TempCertTest(unittest.TestCase):
    def test_temp_cert_success(self):
        fn = None
        with temp_cert(PIN_GOOGLE_CERT) as ca_file:
            fn = ca_file.name
            self.assertTrue(os.path.exists(fn))
        self.assertFalse(os.path.exists(fn))

    def test_temp_cert_raise(self):
        fn = None
        try:
            with temp_cert(PIN_GOOGLE_CERT) as ca_file:
                fn = ca_file.name
                raise ValueError()
            self.fail()
        except ValueError:
            self.assertFalse(os.path.exists(fn))<commit_msg>- rm unused import<commit_after>import os.path
import unittest

from flashproxy.keys import PIN_GOOGLE_CERT, PIN_GOOGLE_PUBKEY_SHA1, check_certificate_pin, temp_cert

class TempCertTest(unittest.TestCase):
    def test_temp_cert_success(self):
        fn = None
        with temp_cert(PIN_GOOGLE_CERT) as ca_file:
            fn = ca_file.name
            self.assertTrue(os.path.exists(fn))
        self.assertFalse(os.path.exists(fn))

    def test_temp_cert_raise(self):
        fn = None
        try:
            with temp_cert(PIN_GOOGLE_CERT) as ca_file:
                fn = ca_file.name
                raise ValueError()
            self.fail()
        except ValueError:
            self.assertFalse(os.path.exists(fn))
{'fraction_non_alphanumeric': 0.07946127946127945, 'fraction_numerical': 0.0013468013468013469, 'mean_word_length': 2.47196261682243, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6618060', 'n_tokens_mistral': 485, 'n_tokens_neox': 471, 'n_words': 87}