Skip to content

Commit

Permalink
chore: remove useless detector test
Browse files Browse the repository at this point in the history
  • Loading branch information
rgmz committed Dec 25, 2024
1 parent c3e845e commit 9e9b4dd
Show file tree
Hide file tree
Showing 354 changed files with 197 additions and 1,967 deletions.
5 changes: 0 additions & 5 deletions pkg/detectors/aha/aha_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ func TestAha_Pattern(t *testing.T) {
input: fmt.Sprintf("aha.io = '%s\n URL is not close to the keyword but should be detected %s'", key, url),
want: []string{key},
},
{
name: "valid pattern - key out of prefix range",
input: fmt.Sprintf("aha.io keyword is not close to the real key and secret = '%s'", validPattern),
want: nil,
},
{
name: "valid pattern - only key",
input: fmt.Sprintf("aha.io %s", key),
Expand Down
5 changes: 0 additions & 5 deletions pkg/detectors/airbrakeprojectkey/airbrakeprojectkey_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ func TestAirBrakeProjectKey_Pattern(t *testing.T) {
input: fmt.Sprintf("airbrake = '%s'", validPattern),
want: []string{"qwmnerBv56zxpocvkjqr78afvYUx90Op451298"},
},
{
name: "valid pattern - key out of prefix range",
input: fmt.Sprintf("airbrake keyword is not close to the real key and secret = '%s'", validPattern),
want: nil,
},
{
name: "valid pattern - only key",
input: fmt.Sprintf("airbrake %s", strings.Split(validPattern, "/")[0]),
Expand Down
5 changes: 0 additions & 5 deletions pkg/detectors/airbrakeuserkey/airbrakeuserkey_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ func TestAirBrakeUserKey_Pattern(t *testing.T) {
input: fmt.Sprintf("airbrake = '%s'", validPattern),
want: []string{validPattern},
},
{
name: "valid pattern - key out of prefix range",
input: fmt.Sprintf("airbrake keyword is not close to the real key and secret = '%s'", validPattern),
want: nil,
},
{
name: "invalid pattern",
input: fmt.Sprintf("airbrake = '%s'", invalidPattern),
Expand Down
5 changes: 0 additions & 5 deletions pkg/detectors/airship/airship_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ func TestAirship_Pattern(t *testing.T) {
input: fmt.Sprintf("airship = '%s'", validPattern),
want: []string{validPattern},
},
{
name: "valid pattern - key out of prefix range",
input: fmt.Sprintf("airship keyword is not close to the real key and secret = '%s'", validPattern),
want: nil,
},
{
name: "invalid pattern",
input: fmt.Sprintf("airship = '%s'", invalidPattern),
Expand Down
5 changes: 0 additions & 5 deletions pkg/detectors/airvisual/airvisual_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ func TestAirVisual_Pattern(t *testing.T) {
input: fmt.Sprintf("airvisual = '%s'", validPattern),
want: []string{validPattern},
},
{
name: "valid pattern - key out of prefix range",
input: fmt.Sprintf("airvisual keyword is not close to the real key and secret = '%s'", validPattern),
want: nil,
},
{
name: "invalid pattern",
input: fmt.Sprintf("airvisual key: '%s'", invalidPattern),
Expand Down
5 changes: 0 additions & 5 deletions pkg/detectors/aiven/aiven_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ func TestAiven_Pattern(t *testing.T) {
input: fmt.Sprintf("aiven = '%s'", validPattern),
want: []string{validPattern},
},
{
name: "valid pattern - key out of prefix range",
input: fmt.Sprintf("aiven keyword is not close to the real key and secret = '%s'", validPattern),
want: nil,
},
{
name: "invalid pattern",
input: fmt.Sprintf("aiven = '%s'", invalidPattern),
Expand Down
5 changes: 0 additions & 5 deletions pkg/detectors/alconost/alconost_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ func TestAlconost_Pattern(t *testing.T) {
input: fmt.Sprintf("alconost: '%s'", validPattern),
want: []string{validPattern},
},
{
name: "valid pattern - key out of prefix range",
input: fmt.Sprintf("alconost keyword is not close to the real key in the data = '%s'", validPattern),
want: nil,
},
{
name: "invalid pattern",
input: fmt.Sprintf("alconost: '%s'", invalidPattern),
Expand Down
5 changes: 0 additions & 5 deletions pkg/detectors/alegra/alegra_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ func TestAlegra_Pattern(t *testing.T) {
input: fmt.Sprintf("alegra: %s", validSpecialCharPattern),
want: []string{"wdvn-usa87a-fxp9ioas:[email protected]"},
},
{
name: "valid pattern - key out of prefix range",
input: fmt.Sprintf("alegra keyword is not close to the real key and id = %s", validPattern),
want: nil,
},
{
name: "invalid pattern",
input: fmt.Sprintf("alegra: %s", invalidPattern),
Expand Down
5 changes: 0 additions & 5 deletions pkg/detectors/aletheiaapi/aletheiaapi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ func TestAleTheIaAPI_Pattern(t *testing.T) {
input: fmt.Sprintf("aletheiaapi: '%s'", validPattern),
want: []string{validPattern},
},
{
name: "valid pattern - key out of prefix range",
input: fmt.Sprintf("aletheiaapi keyword is not close to the real key and secret = '%s'", validPattern),
want: nil,
},
{
name: "invalid pattern",
input: fmt.Sprintf("aletheiaapi: '%s'", invalidPattern),
Expand Down
5 changes: 0 additions & 5 deletions pkg/detectors/algoliaadminkey/algoliaadminkey_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ func TestAlgoliaAdminKey_Pattern(t *testing.T) {
input: fmt.Sprintf("algolia: '%s'", validPattern),
want: []string{"ADMIN01KEY:AlgoliaAdminKey010TESTINGPlmiOPC"},
},
{
name: "valid pattern - key out of prefix range",
input: fmt.Sprintf("algolia keyword is not close to the real key and secret = '%s'", validPattern),
want: nil,
},
{
name: "invalid pattern",
input: fmt.Sprintf("algolia: '%s'", invalidPattern),
Expand Down
5 changes: 0 additions & 5 deletions pkg/detectors/alienvault/alienvault_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ func TestAlienVault_Pattern(t *testing.T) {
input: fmt.Sprintf("alienvault: '%s'", validPattern),
want: []string{validPattern},
},
{
name: "valid pattern - key out of prefix range",
input: fmt.Sprintf("alienvault keyword is not close to the real key in the data\n = '%s'", validPattern),
want: nil,
},
{
name: "invalid pattern",
input: fmt.Sprintf("alienvault: '%s'", invalidPattern),
Expand Down
5 changes: 0 additions & 5 deletions pkg/detectors/allsports/allsports_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ func TestAllSports_Pattern(t *testing.T) {
input: fmt.Sprintf("allsports: '%s'", validPattern),
want: []string{validPattern},
},
{
name: "valid pattern - key out of prefix range",
input: fmt.Sprintf("allsports keyword is not close to the real key in the data\n = '%s'", validPattern),
want: nil,
},
{
name: "invalid pattern",
input: fmt.Sprintf("allsports: '%s'", invalidPattern),
Expand Down
5 changes: 0 additions & 5 deletions pkg/detectors/amadeus/amadeus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ func TestAmadeus_Pattern(t *testing.T) {
input: fmt.Sprintf("amadeus: '%s'", validPattern),
want: []string{"A1b2C3d4E5f6G7h8I9j0K1l2M3n4O5p6A1b2C3d4E5f6G7ho"},
},
{
name: "valid pattern - key out of prefix range",
input: fmt.Sprintf("amadeus keyword is not close to the real key in the data\n = '%s'", validPattern),
want: nil,
},
{
name: "invalid pattern",
input: fmt.Sprintf("amadeus: '%s'", invalidPattern),
Expand Down
5 changes: 0 additions & 5 deletions pkg/detectors/ambee/ambee_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ func TestAmbee_Pattern(t *testing.T) {
input: fmt.Sprintf("ambee: '%s'", validPattern),
want: []string{"a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4"},
},
{
name: "valid pattern - key out of prefix range",
input: fmt.Sprintf("ambee keyword is not close to the real key in the data\n = '%s'", validPattern),
want: nil,
},
{
name: "invalid pattern",
input: fmt.Sprintf("ambee: '%s'", invalidPattern),
Expand Down
5 changes: 0 additions & 5 deletions pkg/detectors/checkvist/checkvist_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ func TestCheckvist_Pattern(t *testing.T) {
input: fmt.Sprintf("checkvist: %s", validPattern),
want: []string{"[email protected]"},
},
{
name: "valid pattern - key out of prefix range",
input: fmt.Sprintf("checkvist keyword is not close to the real key and id = %s", validPattern),
want: nil,
},
{
name: "invalid pattern",
input: fmt.Sprintf("checkvist: %s", invalidPattern),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ func TestCloudFlareGlobalAPIKey_Pattern(t *testing.T) {
input: fmt.Sprintf("cloudflare: %s", validPattern),
want: []string{"[email protected]"},
},
{
name: "valid pattern - key out of prefix range",
input: fmt.Sprintf("cloudflare keyword is not close to the real key and id = %s", validPattern),
want: nil,
},
{
name: "invalid pattern",
input: fmt.Sprintf("cloudflare: %s", invalidPattern),
Expand Down
5 changes: 0 additions & 5 deletions pkg/detectors/cloze/cloze_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ func TestCloze_Pattern(t *testing.T) {
input: fmt.Sprintf("cloze: %s", validPattern),
want: []string{"1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d"},
},
{
name: "valid pattern - key out of prefix range",
input: fmt.Sprintf("cloze keyword is not close to the real key and id = %s", validPattern),
want: nil,
},
{
name: "invalid pattern",
input: fmt.Sprintf("cloze: %s", invalidPattern),
Expand Down
5 changes: 0 additions & 5 deletions pkg/detectors/currencycloud/currencycloud_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ func TestCurrencyCloud_Pattern(t *testing.T) {
input: fmt.Sprintf("currencycloud: %s", validPattern),
want: []string{"1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b"},
},
{
name: "valid pattern - key out of prefix range",
input: fmt.Sprintf("currencycloud keyword is not close to the real key and id = %s", validPattern),
want: nil,
},
{
name: "invalid pattern",
input: fmt.Sprintf("currencycloud: %s", invalidPattern),
Expand Down
5 changes: 0 additions & 5 deletions pkg/detectors/gocanvas/gocanvas_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ func TestGoCanvas_Pattern(t *testing.T) {
input: fmt.Sprintf("gocanvas: %s", validPattern),
want: []string{"Abc123+/Xyz456mnopQRStuvw89YZ12345678ABad6C="},
},
{
name: "valid pattern - key out of prefix range",
input: fmt.Sprintf("gocanvas keyword is not close to the real key and id = %s", validPattern),
want: nil,
},
{
name: "invalid pattern",
input: fmt.Sprintf("gocanvas: %s", invalidPattern),
Expand Down
5 changes: 0 additions & 5 deletions pkg/detectors/ibmclouduserkey/ibmclouduserkey_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ func TestIbmCloudUserKey_Pattern(t *testing.T) {
input: fmt.Sprintf("%s token = '%s' | '%s'", keyword, validPattern, validPattern),
want: []string{validPattern},
},
{
name: "valid pattern - key out of prefix range",
input: fmt.Sprintf("%s keyword is not close to the real key in the data\n = '%s'", keyword, validPattern),
want: []string{},
},
{
name: "invalid pattern",
input: fmt.Sprintf("%s = '%s'", keyword, invalidPattern),
Expand Down
7 changes: 1 addition & 6 deletions pkg/detectors/iconfinder/iconfinder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@ func TestIconFinder_Pattern(t *testing.T) {
name: "valid pattern - ignore duplicate",
input: fmt.Sprintf("%s token = '%s' | '%s'", keyword, validPattern, validPattern),
want: []string{validPattern},
},
{
name: "valid pattern - key out of prefix range",
input: fmt.Sprintf("%s keyword is not close to the real key in the data\n = '%s'", keyword, validPattern),
want: []string{},
},
},
{
name: "invalid pattern",
input: fmt.Sprintf("%s = '%s'", keyword, invalidPattern),
Expand Down
7 changes: 1 addition & 6 deletions pkg/detectors/iexapis/iexapis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@ func TestIexapis_Pattern(t *testing.T) {
name: "valid pattern - ignore duplicate",
input: fmt.Sprintf("%s token = '%s' | '%s'", keyword, validPattern, validPattern),
want: []string{validPattern},
},
{
name: "valid pattern - key out of prefix range",
input: fmt.Sprintf("%s keyword is not close to the real key in the data\n = '%s'", keyword, validPattern),
want: []string{},
},
},
{
name: "invalid pattern",
input: fmt.Sprintf("%s = '%s'", keyword, invalidPattern),
Expand Down
7 changes: 1 addition & 6 deletions pkg/detectors/iexcloud/iexcloud_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@ func TestIexcloud_Pattern(t *testing.T) {
name: "valid pattern - ignore duplicate",
input: fmt.Sprintf("%s token = '%s' | '%s'", keyword, validPattern, validPattern),
want: []string{validPattern},
},
{
name: "valid pattern - key out of prefix range",
input: fmt.Sprintf("%s keyword is not close to the real key in the data\n = '%s'", keyword, validPattern),
want: []string{},
},
},
{
name: "invalid pattern",
input: fmt.Sprintf("%s = '%s'", keyword, invalidPattern),
Expand Down
7 changes: 1 addition & 6 deletions pkg/detectors/imagekit/imagekit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@ func TestImagekit_Pattern(t *testing.T) {
name: "valid pattern - ignore duplicate",
input: fmt.Sprintf("%s token = '%s' | '%s'", keyword, validPattern, validPattern),
want: []string{validPattern},
},
{
name: "valid pattern - key out of prefix range",
input: fmt.Sprintf("%s keyword is not close to the real key in the data\n = '%s'", keyword, validPattern),
want: []string{},
},
},
{
name: "invalid pattern",
input: fmt.Sprintf("%s = '%s'", keyword, invalidPattern),
Expand Down
7 changes: 1 addition & 6 deletions pkg/detectors/imagga/imagga_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@ func TestImagga_Pattern(t *testing.T) {
name: "valid pattern - ignore duplicate",
input: fmt.Sprintf("%s token = '%s' | '%s'", keyword, validPattern, validPattern),
want: []string{validPattern},
},
{
name: "valid pattern - key out of prefix range",
input: fmt.Sprintf("%s keyword is not close to the real key in the data\n = '%s'", keyword, validPattern),
want: []string{},
},
},
{
name: "invalid pattern",
input: fmt.Sprintf("%s = '%s'", keyword, invalidPattern),
Expand Down
7 changes: 1 addition & 6 deletions pkg/detectors/impala/impala_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@ func TestImpala_Pattern(t *testing.T) {
name: "valid pattern - ignore duplicate",
input: fmt.Sprintf("%s token = '%s' | '%s'", keyword, validPattern, validPattern),
want: []string{validPattern},
},
{
name: "valid pattern - key out of prefix range",
input: fmt.Sprintf("%s keyword is not close to the real key in the data\n = '%s'", keyword, validPattern),
want: []string{},
},
},
{
name: "invalid pattern",
input: fmt.Sprintf("%s = '%s'", keyword, invalidPattern),
Expand Down
7 changes: 1 addition & 6 deletions pkg/detectors/infura/infura_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@ func TestInfura_Pattern(t *testing.T) {
name: "valid pattern - ignore duplicate",
input: fmt.Sprintf("%s token = '%s' | '%s'", keyword, validPattern, validPattern),
want: []string{validPattern},
},
{
name: "valid pattern - key out of prefix range",
input: fmt.Sprintf("%s keyword is not close to the real key in the data\n = '%s'", keyword, validPattern),
want: []string{},
},
},
{
name: "invalid pattern",
input: fmt.Sprintf("%s = '%s'", keyword, invalidPattern),
Expand Down
7 changes: 1 addition & 6 deletions pkg/detectors/insightly/insightly_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@ func TestInsightly_Pattern(t *testing.T) {
name: "valid pattern - ignore duplicate",
input: fmt.Sprintf("%s token = '%s' | '%s'", keyword, validPattern, validPattern),
want: []string{validPattern},
},
{
name: "valid pattern - key out of prefix range",
input: fmt.Sprintf("%s keyword is not close to the real key in the data\n = '%s'", keyword, validPattern),
want: []string{},
},
},
{
name: "invalid pattern",
input: fmt.Sprintf("%s = '%s'", keyword, invalidPattern),
Expand Down
7 changes: 1 addition & 6 deletions pkg/detectors/instabot/instabot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@ func TestInstabot_Pattern(t *testing.T) {
name: "valid pattern - ignore duplicate",
input: fmt.Sprintf("%s token = '%s' | '%s'", keyword, validPattern, validPattern),
want: []string{validPattern},
},
{
name: "valid pattern - key out of prefix range",
input: fmt.Sprintf("%s keyword is not close to the real key in the data\n = '%s'", keyword, validPattern),
want: []string{},
},
},
{
name: "invalid pattern",
input: fmt.Sprintf("%s = '%s'", keyword, invalidPattern),
Expand Down
7 changes: 1 addition & 6 deletions pkg/detectors/instamojo/instamojo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,7 @@ func TestInstamojo_Pattern(t *testing.T) {
name: "valid pattern - with keyword instamojo",
input: fmt.Sprintf("%s '%s' %s '%s'", keyword, validKeyPattern, keyword, validSecretPattern),
want: []string{"ZrGOAl9jlTlAKxw4hXZXeRmd6wvndEr2pX0fqDv2"},
},
{
name: "valid pattern - key out of prefix range",
input: fmt.Sprintf("%s keyword is not close to the real key in the data\n = '%s' secret = '%s'", keyword, validKeyPattern, validSecretPattern),
want: []string{},
},
},
{
name: "invalid pattern",
input: fmt.Sprintf("%s key = '%s' secret = '%s'", keyword, invalidKeyPattern, invalidSecretPattern),
Expand Down
7 changes: 1 addition & 6 deletions pkg/detectors/intercom/intercom_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@ func TestInterCom_Pattern(t *testing.T) {
name: "valid pattern - ignore duplicate",
input: fmt.Sprintf("%s token = '%s' | '%s'", keyword, validPattern, validPattern),
want: []string{validPattern},
},
{
name: "valid pattern - key out of prefix range",
input: fmt.Sprintf("%s keyword is not close to the real key in the data\n = '%s'", keyword, validPattern),
want: []string{},
},
},
{
name: "invalid pattern",
input: fmt.Sprintf("%s = '%s'", keyword, invalidPattern),
Expand Down
Loading

0 comments on commit 9e9b4dd

Please sign in to comment.