forked from lagerfeuer/gitignore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
28 lines (20 loc) · 749 Bytes
/
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
import unittest
from giig import *
# define some languages to test for:
EXAMPLE_LIST = ["linux", "python", "c", "java", "intellij", "eclipse"]
class TestStringMethods(unittest.TestCase):
def test_get_list(self):
result = giig._get_list()
for item in EXAMPLE_LIST:
self.assertIn(item, result)
def test_search(self):
result = giig._search("java")
self.assertEqual(3, len(result))
result = giig._search("python")
self.assertEqual(1, len(result))
def test_gitignore(self):
result = giig._get_gitignore(["linux", "python"])
self.assertIn("### Linux ###", result)
self.assertIn("### Python ###", result)
if __name__ == "__main__":
unittest.main()