示例#1
0
    def test_get_stats_audited_real_only(
        self,
        live_secrets_fixture,
        unaudited_secrets_fixture,
        audited_real_secrets_fixture,
    ):
        with self.mock_env():
            stats = get_stats(
                live_secrets_fixture,
                unaudited_secrets_fixture,
                audited_real_secrets_fixture,
                baseline_filename,
                False,
                False,
                True,
            )
            secrets = audit.get_secrets_list_from_file(baseline_filename)

        assert stats == {
            'reviewed': len(secrets),
            'audited_real': len(audited_real_secrets_fixture),
        }
示例#2
0
    def test_get_stats_no_failed_conditions(
        self,
        live_secrets_fixture,
        unaudited_secrets_fixture,
        audited_real_secrets_fixture,
    ):
        with self.mock_env():
            stats = get_stats(
                live_secrets_fixture,
                unaudited_secrets_fixture,
                audited_real_secrets_fixture,
                baseline_filename,
                True,
                True,
                True,
            )
            secrets = audit.get_secrets_list_from_file(baseline_filename)

        assert stats == {
            'reviewed': len(secrets),
            'live': len(live_secrets_fixture),
            'unaudited': len(unaudited_secrets_fixture),
            'audited_real': len(audited_real_secrets_fixture),
        }