-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
40 lines (31 loc) · 975 Bytes
/
Copy pathtest.py
File metadata and controls
40 lines (31 loc) · 975 Bytes
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
"""
█▀ █▄█ █▀▀ █░█ █▀▀ █░█
▄█ ░█░ █▄▄ █▀█ ██▄ ▀▄▀
Author: <Anton Sychev> (anton at sychev dot xyz)
test.py (c) 2024
Created: 2024-01-04 00:14:32
Desc: test cases
"""
# TODO: complete test unit
"""
import unittest
from python_ack.ack import ack
class TestAck(unittest.TestCase):
def setUp(self):
self.ack_instance = ack(
path=".",
regexp="apple",
num_processes=4,
exclude_paths_regexp=[],
follow_links=False,
exclude_regexp=["2"],
use_ansi_colors=True,
return_as_dict=False,
)
def test_is_excluded(self):
self.assertFalse(self.ack_instance.is_excluded("filename.txt", ["apple"]))
# Test when filename matches the regexp
self.assertTrue(self.ack_instance.is_excluded("apple_filename.txt", ["apple"]))
if __name__ == "__main__":
unittest.main()
"""