-
Notifications
You must be signed in to change notification settings - Fork 481
/
slack_test.py
41 lines (36 loc) · 1.11 KB
/
slack_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import pytest
from detect_secrets.plugins.slack import SlackDetector
class TestSlackDetector:
@pytest.mark.parametrize(
'line',
[
(
'xoxp-523423-234243-234233-e039d02840a0b9379c'
),
(
'xoxo-523423-234243-234233-e039d02840a0b9379c'
),
(
'xoxs-523423-234243-234233-e039d02840a0b9379c'
),
(
'xoxa-511111111-31111111111-3111111111111-e039d02840a0b9379c'
),
(
'xoxa-2-511111111-31111111111-3111111111111-e039d02840a0b9379c'
),
(
'xoxr-523423-234243-234233-e039d02840a0b9379c'
),
(
'xoxb-34532454-e039d02840a0b9379c'
),
(
'https://hooks.slack.com/services/Txxxxxxxx/Bxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxx'
),
],
)
def test_analyze(self, line):
logic = SlackDetector()
output = logic.analyze_line(filename='mock_filename', line=line)
assert len(output) == 1