<commit_before>package main

import (
	"net/http"
	"testing"
)

func TestGetNewHoverflyCheckConfig(t *testing.T) {

	cfg := InitSettings()
	_, dbClient := getNewHoverfly(cfg)
	defer dbClient.cache.db.Close()

	expect(t, dbClient.cfg, cfg)
}<commit_msg>test capture request<commit_after>package main

import (
	"net/http"
	"testing"
)

func TestGetNewHoverflyCheckConfig(t *testing.T) {

	cfg := InitSettings()
	_, dbClient := getNewHoverfly(cfg)
	defer dbClient.cache.db.Close()

	expect(t, dbClient.cfg, cfg)
}

func TestProcessCaptureRequest(t *testing.T) {
	server, dbClient := testTools(201, `{'message': 'here'}`)
	defer server.Close()
	defer dbClient.cache.DeleteBucket(dbClient.cache.requestsBucket)

	r, err := http.NewRequest("GET", "http://somehost.com", nil)
	expect(t, err, nil)

	dbClient.cfg.SetMode("capture")

	req, resp := dbClient.processRequest(r)

	refute(t, req, nil)
	refute(t, resp, nil)
	expect(t, resp.StatusCode, 201)
}
{'fraction_non_alphanumeric': 0.15343915343915343, 'fraction_numerical': 0.006349206349206349, 'mean_word_length': 5.391891891891892, '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': '2683207', 'n_tokens_mistral': 363, 'n_tokens_neox': 348, 'n_words': 69}