Skip to content

Commit dfaa4d9

Browse files
committed
update: failure test 3
1 parent e649a05 commit dfaa4d9

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

snippets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3162,7 +3162,7 @@
31623162
{
31633163
"description": "r - Brazilian CPF",
31643164
"id": 633,
3165-
"trigger": "r.bcpfcnpj"
3165+
"trigger": "r.bcpf"
31663166
},
31673167
{
31683168
"description": "r - Brazilian Phone",

source/__init__.py

Whitespace-only changes.

source/__init__.pyc

114 Bytes
Binary file not shown.

source/json_generator.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ def get_dir(path, ext):
2121
matches.append(os.path.join(root, filename))
2222
return matches
2323

24-
def get_json():
24+
def get_json(path):
2525
result = []
26-
for count, file in enumerate(get_dir('../snippets/', '*.sublime-snippet'), start=1):
26+
for count, file in enumerate(get_dir( path, '*.sublime-snippet'), start=1):
2727
line = open(file)
2828
content = line.read()
2929
trigger = content.split('<tabTrigger>')[1].split('</tabTrigger>')[0]
@@ -34,5 +34,4 @@ def get_json():
3434
return result
3535

3636

37-
write_json(get_json(), "../snippets.json")
38-
37+
write_json(get_json('../snippets/'), "../snippets.json")

tests/test.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
#!/usr/bin/env python3
22

33
import sys
4-
sys.path.append('source/')
5-
from json_generator import get_json
6-
from duplicates import list_duplicates
4+
import os.path
5+
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
6+
from source.json_generator import get_json
7+
from source.duplicates import list_duplicates
78
import json
89
import re
910
import unittest
1011

1112
class TestDuplicatesMethods(unittest.TestCase):
1213

1314
def test_duplicates(self):
14-
json = get_json()
15+
json = get_json('snippets/')
1516
triggers = []
16-
17+
print json
1718
for snippet in json:
1819
trigger = snippet['trigger']
1920
if re.search(r'z.', trigger) is None:

0 commit comments

Comments
 (0)