InQuest / ThreatIngestor

Extract and aggregate threat intelligence.
https://inquest.readthedocs.io/projects/threatingestor/
GNU General Public License v2.0
832 stars 135 forks source link

Erros in unit tests #78

Closed ninoseki closed 4 years ago

ninoseki commented 4 years ago

I got following erros when executing unit tests.

$ git clone https://github.com/InQuest/ThreatIngestor
$ cd ThreatIngestor/
$ pip install -r requirements.txt
$ pip install -r requirements-testing.txt
$ nosetests
...
======================================================================
ERROR: test_run_does_preprocessing_deobfuscation (test_sources_rss.TestRSS)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/Foo/.anyenv/envs/pyenv/versions/3.6.10/lib/python3.6/site-packages/httpretty/core.py", line 1702, in wrapper
    return test(*args, **kw)
  File "/Users/Foo/Documents/GitHub/ThreatIngestor/tests/test_sources_rss.py", line 81, in test_run_does_preprocessing_deobfuscation
    saved_state, artifacts = self.rss.run(None)
  File "/Users/Foo/Documents/GitHub/ThreatIngestor/threatingestor/sources/rss.py", line 26, in run
    if published_parsed and published_parsed <= feedparser._parse_date(saved_state or '0000-00-00'):
TypeError: '<=' not supported between instances of 'time.struct_time' and 'NoneType'

======================================================================
ERROR: test_run_respects_feed_type (test_sources_rss.TestRSS)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/Foo/.anyenv/envs/pyenv/versions/3.6.10/lib/python3.6/site-packages/httpretty/core.py", line 1702, in wrapper
    return test(*args, **kw)
  File "/Users/Foo/Documents/GitHub/ThreatIngestor/tests/test_sources_rss.py", line 95, in test_run_respects_feed_type
    saved_state, artifacts = messy.run(None)
  File "/Users/Foo/Documents/GitHub/ThreatIngestor/threatingestor/sources/rss.py", line 26, in run
    if published_parsed and published_parsed <= feedparser._parse_date(saved_state or '0000-00-00'):
TypeError: '<=' not supported between instances of 'time.struct_time' and 'NoneType'

======================================================================
ERROR: test_run_respects_saved_state (test_sources_rss.TestRSS)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/Foo/.anyenv/envs/pyenv/versions/3.6.10/lib/python3.6/site-packages/httpretty/core.py", line 1702, in wrapper
    return test(*args, **kw)
  File "/Users/Foo/Documents/GitHub/ThreatIngestor/tests/test_sources_rss.py", line 67, in test_run_respects_saved_state
    saved_state, artifacts = self.rss.run(None)
  File "/Users/Foo/Documents/GitHub/ThreatIngestor/threatingestor/sources/rss.py", line 26, in run
    if published_parsed and published_parsed <= feedparser._parse_date(saved_state or '0000-00-00'):
TypeError: '<=' not supported between instances of 'time.struct_time' and 'NoneType'

======================================================================
ERROR: test_run_returns_artifacts_correctly (test_sources_rss.TestRSS)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/Foo/.anyenv/envs/pyenv/versions/3.6.10/lib/python3.6/site-packages/httpretty/core.py", line 1702, in wrapper
    return test(*args, **kw)
  File "/Users/Foo/Documents/GitHub/ThreatIngestor/tests/test_sources_rss.py", line 155, in test_run_returns_artifacts_correctly
    saved_state, artifacts = self.rss.run(None)
  File "/Users/Foo/Documents/GitHub/ThreatIngestor/threatingestor/sources/rss.py", line 26, in run
    if published_parsed and published_parsed <= feedparser._parse_date(saved_state or '0000-00-00'):
TypeError: '<=' not supported between instances of 'time.struct_time' and 'NoneType'

======================================================================
ERROR: test_run_returns_top_item_date_as_saved_state (test_sources_rss.TestRSS)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/Foo/.anyenv/envs/pyenv/versions/3.6.10/lib/python3.6/site-packages/httpretty/core.py", line 1702, in wrapper
    return test(*args, **kw)
  File "/Users/Foo/Documents/GitHub/ThreatIngestor/tests/test_sources_rss.py", line 146, in test_run_returns_top_item_date_as_saved_state
    saved_state, artifacts = self.rss.run(None)
  File "/Users/Foo/Documents/GitHub/ThreatIngestor/threatingestor/sources/rss.py", line 26, in run
    if published_parsed and published_parsed <= feedparser._parse_date(saved_state or '0000-00-00'):
TypeError: '<=' not supported between instances of 'time.struct_time' and 'NoneType'

======================================================================
ERROR: test_run_supports_both_content_summary (test_sources_rss.TestRSS)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/Foo/.anyenv/envs/pyenv/versions/3.6.10/lib/python3.6/site-packages/httpretty/core.py", line 1702, in wrapper
    return test(*args, **kw)
  File "/Users/Foo/Documents/GitHub/ThreatIngestor/tests/test_sources_rss.py", line 118, in test_run_supports_both_content_summary
    saved_state, artifacts = self.rss.run(None)
  File "/Users/Foo/Documents/GitHub/ThreatIngestor/threatingestor/sources/rss.py", line 26, in run
    if published_parsed and published_parsed <= feedparser._parse_date(saved_state or '0000-00-00'):
TypeError: '<=' not supported between instances of 'time.struct_time' and 'NoneType'

======================================================================
ERROR: test_run_supports_both_link_url (test_sources_rss.TestRSS)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/Foo/.anyenv/envs/pyenv/versions/3.6.10/lib/python3.6/site-packages/httpretty/core.py", line 1702, in wrapper
    return test(*args, **kw)
  File "/Users/Foo/Documents/GitHub/ThreatIngestor/tests/test_sources_rss.py", line 128, in test_run_supports_both_link_url
    saved_state, artifacts = self.rss.run(None)
  File "/Users/Foo/Documents/GitHub/ThreatIngestor/threatingestor/sources/rss.py", line 26, in run
    if published_parsed and published_parsed <= feedparser._parse_date(saved_state or '0000-00-00'):
TypeError: '<=' not supported between instances of 'time.struct_time' and 'NoneType'

----------------------------------------------------------------------
Ran 139 tests in 0.947s

FAILED (errors=7)