Skip to content

Commit

Permalink
Adds tests for connectivity combiner
Browse files Browse the repository at this point in the history
  • Loading branch information
irl committed Aug 26, 2018
1 parent 5b89717 commit 20d65a2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions pathspider/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class Spider:
"""

name = "spider"
chains = [] # Disable the observer by default

def __init__(self, worker_count, libtrace_uri, args, server_mode):
Expand Down
17 changes: 17 additions & 0 deletions pathspider/tests/test_combine_connectivity.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from nose.tools import assert_equal

from pathspider.base import Spider

def test_combine_connectivity():
spider = Spider(0, "", None, False)

combinations = [(True, True, "spider.connectivity.works", None),
(True, False, "spider.connectivity.broken", None),
(False, True, "spider.connectivity.transient", None),
(False, False, "spider.connectivity.offline", None),
(True, None, "spider.connectivity.online", None),
(True, True, "dummy.connectivity.works", "dummy")]

for combination in combinations:
assert_equal(spider.combine_connectivity(combination[0],
combination[1], prefix=combination[3]), combination[2])

0 comments on commit 20d65a2

Please sign in to comment.