Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a50eaed

Browse files
committedFeb 1, 2018
updating tests for travis ci
1 parent e95221f commit a50eaed

File tree

2 files changed

+16
-17
lines changed

2 files changed

+16
-17
lines changed
 

‎tests/test_feeds.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@
33
import os
44

55
def test_feeds_have_name():
6-
for i in os.listdir("../feeds.d"):
6+
for i in os.listdir("feeds.d"):
77
if i.endswith(".json"):
8-
with open("../feeds.d/{}".format(i), "r") as infile:
8+
with open("feeds.d/{}".format(i), "r") as infile:
99
data = json.load(infile)
1010
for feed in data['feeds']:
1111
assert len(feed['feed_name']) >= 1
1212

1313
def test_feeds_have_type():
14-
for i in os.listdir("../feeds.d"):
14+
for i in os.listdir("feeds.d"):
1515
if i.endswith(".json"):
16-
with open("../feeds.d/{}".format(i), "r") as infile:
16+
with open("feeds.d/{}".format(i), "r") as infile:
1717
data = json.load(infile)
1818
for feed in data['feeds']:
1919
print(feed['feed_name'])
20-
print("../feeds.d/{}".format(i))
20+
print("feeds.d/{}".format(i))
2121
if feed['feed_type'] == 'txt' or feed['feed_type'] == 'csv':
2222
is_txt_or_csv = True
2323
else:
@@ -26,9 +26,9 @@ def test_feeds_have_type():
2626

2727
def test_csv_feeds():
2828
csv_feeds = []
29-
for i in os.listdir("../feeds.d"):
29+
for i in os.listdir("feeds.d"):
3030
if i.endswith(".json"):
31-
with open("../feeds.d/{}".format(i), "r") as infile:
31+
with open("feeds.d/{}".format(i), "r") as infile:
3232
data = json.load(infile)
3333
for feed in data['feeds']:
3434
if feed['feed_type'] == "csv":
@@ -49,9 +49,9 @@ def test_csv_feeds():
4949

5050
def test_txt_feeds():
5151
txt_feeds = []
52-
for i in os.listdir("../feeds.d"):
52+
for i in os.listdir("feeds.d"):
5353
if i.endswith(".json"):
54-
with open("../feeds.d/{}".format(i), "r") as infile:
54+
with open("feeds.d/{}".format(i), "r") as infile:
5555
data = json.load(infile)
5656
for feed in data['feeds']:
5757
if feed['feed_type'] == "txt":

‎tests/test_ioc_parser.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,33 @@
1+
'''
2+
IOC parser tests
3+
'''
14
import pytest
25
import json
36
import pandas
4-
#from elasticintel.ingest_feed_lambda.ioc_feed_parser import IOCFeedParser
57
from ingest_feed_lambda.ioc_feed_parser import IOCFeedParser
6-
#from ingest_feed_lambda.ioc_feed_parser import IOCFeedParser
78

89
@pytest.fixture
910
def txt_feed_dict():
10-
with open("test_feeds/txt_feed.json", "r") as infile:
11+
with open("tests/test_feeds/txt_feed.json", "r") as infile:
1112
feed = json.load(infile)
1213
return feed
1314

1415
@pytest.fixture
1516
def txt_feed_data():
16-
with open("test_feeds/test_txt_data.txt", "r") as infile:
17+
with open("tests/test_feeds/test_txt_data.txt", "r") as infile:
1718
feed_data = infile.read()
1819
return feed_data
1920

2021

2122
@pytest.fixture
2223
def csv_feed_dict():
23-
with open("test_feeds/csv_feed.json", "r") as infile:
24+
with open("tests/test_feeds/csv_feed.json", "r") as infile:
2425
feed = json.load(infile)
2526
return feed
2627

2728
@pytest.fixture
2829
def csv_test_data():
29-
with open("test_feeds/test_csv_data.txt", "r") as infile:
30+
with open("tests/test_feeds/test_csv_data.txt", "r") as infile:
3031
feed_data = infile.read()
3132
return feed_data
3233

@@ -46,8 +47,6 @@ def test_parse_feed_type():
4647
txt_feed = txt_feed_dict()
4748
csv_veed = csv_feed_dict()
4849

49-
50-
5150
def test_clean_csv_feed():
5251
feed = csv_feed_dict()
5352
data = csv_test_data()

0 commit comments

Comments
 (0)
Please sign in to comment.