Skip to content

Instantly share code, notes, and snippets.

@jarhill0
Created January 25, 2018 02:24
Show Gist options
  • Select an option

  • Save jarhill0/894857708e47a538f504662448ccfddd to your computer and use it in GitHub Desktop.

Select an option

Save jarhill0/894857708e47a538f504662448ccfddd to your computer and use it in GitHub Desktop.
$ python3 setup.py test
running test
running egg_info
creating pycaching.egg-info
writing pycaching.egg-info/PKG-INFO
writing dependency_links to pycaching.egg-info/dependency_links.txt
writing requirements to pycaching.egg-info/requires.txt
writing top-level names to pycaching.egg-info/top_level.txt
writing manifest file 'pycaching.egg-info/SOURCES.txt'
reading manifest file 'pycaching.egg-info/SOURCES.txt'
writing manifest file 'pycaching.egg-info/SOURCES.txt'
running build_ext
test_load (test.test_cache.TestMethods) ... ERROR
test_load_by_guid (test.test_cache.TestMethods) ... ERROR
test_load_log_page (test.test_cache.TestMethods) ... ok
test_load_logbook (test.test_cache.TestMethods) ... ok
test_load_quick (test.test_cache.TestMethods) ... ok
test_load_trackables (test.test_cache.TestMethods) ... ok
test_post_log (test.test_cache.TestMethods) ... ok
test___eq__ (test.test_cache.TestProperties) ... ok
test___str__ (test.test_cache.TestProperties) ... ok
test_attributes (test.test_cache.TestProperties) ... ok
test_author (test.test_cache.TestProperties) ... ok
test_description (test.test_cache.TestProperties) ... ok
test_difficulty (test.test_cache.TestProperties) ... ok
test_favorites (test.test_cache.TestProperties) ... ok
test_found (test.test_cache.TestProperties) ... ok
test_geocaching (test.test_cache.TestProperties) ... ok
test_guid (test.test_cache.TestProperties) ... ok
test_hidden (test.test_cache.TestProperties) ... ok
test_hint (test.test_cache.TestProperties) ... ok
test_location (test.test_cache.TestProperties) ... ok
test_name (test.test_cache.TestProperties) ... ok
test_original_location (test.test_cache.TestProperties) ... ok
test_pm_only (test.test_cache.TestProperties) ... ok
test_size (test.test_cache.TestProperties) ... ok
test_state (test.test_cache.TestProperties) ... ok
test_summary (test.test_cache.TestProperties) ... ok
test_terrain (test.test_cache.TestProperties) ... ok
test_type (test.test_cache.TestProperties) ... ok
test_waypoints (test.test_cache.TestProperties) ... ok
test_wp (test.test_cache.TestProperties) ... ok
test_id (test.test_cache.TestWaypointProperties) ... ok
test_location (test.test_cache.TestWaypointProperties) ... ok
test_note (test.test_cache.TestWaypointProperties) ... ok
test_str (test.test_cache.TestWaypointProperties) ... ok
test_type (test.test_cache.TestWaypointProperties) ... ok
Test if correct size is determined based on passed points ... ok
Check calculation of block limits when going out of the border ... ok
Check that correct middle points are returned ... ok
Test points operations ... ok
test_to_decimal (test.test_geo.TestModule) ... ok
Test Geocaching point formatting. ... ok
test_from_location (test.test_geo.TestPoint) ... ok
test_from_string (test.test_geo.TestPoint) ... ok
Test coordinate creation from tile ... ok
test_to_tile (test.test_geo.TestPoint) ... ok
test_bounding_box (test.test_geo.TestPolygon) ... ok
test_mean_point (test.test_geo.TestPolygon) ... ok
test_contains (test.test_geo.TestRectangle) ... ok
test_diagonal (test.test_geo.TestRectangle) ... ok
Parse locally stored grid and compare to expected results ... ok
Test if downloading a UTFGrid passes without errors ... ok
test_precision (test.test_geo.TestTile) ... ok
test_get_logged_user (test.test_geocaching.TestLoginOperations) ... ok
test_load_credentials (test.test_geocaching.TestLoginOperations) ... ok
test_login (test.test_geocaching.TestLoginOperations) ... ok
test_logout (test.test_geocaching.TestLoginOperations) ... ok
test_request (test.test_geocaching.TestLoginOperations) ... ok
test_search (test.test_geocaching.TestMethods) ... ok
Perform quick search and check found caches ... /Users/jarhill/PycharmProjects/old_pycaching/pycaching/geocaching.py:315: UserWarning: Quick search is temporary disabled because of Groundspeak breaking change. If you would like to use it, please consider helping with this issue: https://github.com/tomasbedrich/pycaching/issues/75
warnings.warn("Quick search is temporary disabled because of Groundspeak breaking change. "
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/unittest/case.py:546: RuntimeWarning: TestResult has no addExpectedFailure method, reporting as passes
RuntimeWarning)
ok
Test if quick search results matches exact cache locations. ... ok
test_geocode (test.test_geocaching.TestShortcuts) ... ok
test_get_cache (test.test_geocaching.TestShortcuts) ... ok
test_get_trackable (test.test_geocaching.TestShortcuts) ... ok
test_login (test.test_geocaching.TestShortcuts) ... ok
test_post_log (test.test_geocaching.TestShortcuts) ... ok
test___str__ (test.test_log.TestLog) ... ok
test_author (test.test_log.TestLog) ... ok
test_text (test.test_log.TestLog) ... ok
test_type (test.test_log.TestLog) ... ok
test_visited (test.test_log.TestLog) ... ok
test_from_filename (test.test_log.TestType) ... ok
test_get_KML (test.test_trackable.TestMethods) ... ok
test_load (test.test_trackable.TestMethods) ... ok
test_load_log_page (test.test_trackable.TestMethods) ... ok
test_post_log (test.test_trackable.TestMethods) ... ok
test___eq__ (test.test_trackable.TestProperties) ... ok
test___str__ (test.test_trackable.TestProperties) ... ok
test_description (test.test_trackable.TestProperties) ... ok
test_goal (test.test_trackable.TestProperties) ... ok
test_location (test.test_trackable.TestProperties) ... ok
test_log_page_url (test.test_trackable.TestProperties) ... ok
test_name (test.test_trackable.TestProperties) ... ok
test_owner (test.test_trackable.TestProperties) ... ok
test_tid (test.test_trackable.TestProperties) ... ok
test_type (test.test_trackable.TestProperties) ... ok
test_format_date (test.test_util.TestModule) ... ok
test_get_possible_attributes (test.test_util.TestModule) ... ok
test_parse_date (test.test_util.TestModule) ... ok
test_rot13 (test.test_util.TestModule) ... ok
======================================================================
ERROR: test_load (test.test_cache.TestMethods)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/jarhill/PycharmProjects/old_pycaching/test/test_cache.py", line 190, in test_load
self.assertEqual("Entre l'arbre et la grille.", cache.hint)
File "/Users/jarhill/PycharmProjects/old_pycaching/pycaching/util.py", line 30, in wrapper
self.load()
File "/Users/jarhill/PycharmProjects/old_pycaching/pycaching/cache.py", line 682, in load
self.waypoints = Waypoint.from_html(root, "ctl00_ContentBody_Waypoints")
File "/Users/jarhill/PycharmProjects/old_pycaching/pycaching/cache.py", line 956, in from_html
type = columns[2].find("img").get("title")
AttributeError: 'NoneType' object has no attribute 'get'
-------------------- >> begin captured logging << --------------------
root: INFO: Logging in...
root: DEBUG: Checking for previous login.
urllib3.connectionpool: DEBUG: Starting new HTTPS connection (1): www.geocaching.com
urllib3.connectionpool: DEBUG: https://www.geocaching.com:443 "GET /account/login HTTP/1.1" 200 34169
root: DEBUG: Assembling POST data.
root: DEBUG: Submiting login form.
urllib3.connectionpool: DEBUG: https://www.geocaching.com:443 "POST /account/login HTTP/1.1" 302 129
urllib3.connectionpool: DEBUG: https://www.geocaching.com:443 "GET /play/search HTTP/1.1" 200 112682
root: DEBUG: Checking the result.
root: DEBUG: Checking for already logged user.
root: INFO: Logged in successfully as cache-map.
urllib3.connectionpool: DEBUG: https://www.geocaching.com:443 "GET /seek/cache_details.aspx?wp=GC1PAR2 HTTP/1.1" 301 189
urllib3.connectionpool: DEBUG: https://www.geocaching.com:443 "GET /geocache/GC1PAR2_kostel-panny-marie-ruzencove HTTP/1.1" 200 144784
root: DEBUG: Cache loaded: GC1PAR2
urllib3.connectionpool: DEBUG: https://www.geocaching.com:443 "GET /seek/cache_details.aspx?wp=GC4808G HTTP/1.1" 301 176
urllib3.connectionpool: DEBUG: https://www.geocaching.com:443 "GET /geocache/GC4808G_nekonecne-ticho HTTP/1.1" 200 190975
root: DEBUG: Cache loaded: GC4808G
root: DEBUG: Lazy loading name into <object <class 'pycaching.cache.Cache'> id 4565327432>
urllib3.connectionpool: DEBUG: https://www.geocaching.com:443 "GET /seek/cache_details.aspx?wp=GC4808G HTTP/1.1" 301 176
urllib3.connectionpool: DEBUG: https://www.geocaching.com:443 "GET /geocache/GC4808G_nekonecne-ticho HTTP/1.1" 200 190975
root: DEBUG: Cache loaded: GC4808G
root: DEBUG: Lazy loading hint into <object <class 'pycaching.cache.Cache'> id 4563013816>
urllib3.connectionpool: DEBUG: https://www.geocaching.com:443 "GET /seek/cache_details.aspx?wp=GC4FRG5 HTTP/1.1" 301 176
urllib3.connectionpool: DEBUG: https://www.geocaching.com:443 "GET /geocache/GC4FRG5_les-buissonnets HTTP/1.1" 200 153264
--------------------- >> end captured logging << ---------------------
======================================================================
ERROR: test_load_by_guid (test.test_cache.TestMethods)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/unittest/mock.py", line 1179, in patched
return func(*args, **keywargs)
File "/Users/jarhill/PycharmProjects/old_pycaching/test/test_cache.py", line 220, in test_load_by_guid
cache.load_by_guid()
File "/Users/jarhill/PycharmProjects/old_pycaching/pycaching/cache.py", line 785, in load_by_guid
self.waypoints = Waypoint.from_html(content, "Waypoints")
File "/Users/jarhill/PycharmProjects/old_pycaching/pycaching/cache.py", line 956, in from_html
type = columns[2].find("img").get("title")
AttributeError: 'NoneType' object has no attribute 'get'
-------------------- >> begin captured logging << --------------------
urllib3.connectionpool: DEBUG: https://www.geocaching.com:443 "GET /seek/cdpf.aspx?guid=5f45114d-1d79-4fdb-93ae-8f49f1d27188 HTTP/1.1" 200 37816
root: WARNING: Unknown attribute alert, ignoring.
--------------------- >> end captured logging << ---------------------
Name Stmts Miss Cover
---------------------------------------------
pycaching/__init__.py 9 0 100%
pycaching/cache.py 480 42 91%
pycaching/errors.py 16 0 100%
pycaching/geo.py 240 27 89%
pycaching/geocaching.py 163 7 96%
pycaching/log.py 74 0 100%
pycaching/trackable.py 118 4 97%
pycaching/util.py 50 4 92%
---------------------------------------------
TOTAL 1150 84 93%
----------------------------------------------------------------------
Ran 89 tests in 33.700s
FAILED (errors=2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment