@@ -39,55 +39,15 @@ def test_search(self):
39
39
caches = list (self .gc .search (Point (49.733867 , 13.397091 ), 100 ))
40
40
self .assertNotEqual (caches [0 ], caches [50 ])
41
41
42
- @unittest .expectedFailure
43
42
def test_search_quick (self ):
44
43
"""Perform quick search and check found caches"""
45
- # at time of writing, there were exactly 16 caches in this area + one PM only
46
- expected_cache_num = 16
47
- tolerance = 7
48
44
rect = Rectangle (Point (49.73 , 13.38 ), Point (49.74 , 13.40 ))
49
45
50
- with self .subTest ("normal" ):
51
- with self .recorder .use_cassette ("geocaching_quick_normal" ):
52
- # Once this feature is fixed, the corresponding cassette will have to be deleted
53
- # and re-recorded.
54
- res = [c .wp for c in self .gc .search_quick (rect )]
55
- for wp in ["GC41FJC" , "GC17E8Y" , "GC383XN" ]:
56
- self .assertIn (wp , res )
57
- # but 108 caches larger tile
58
- self .assertLess (len (res ), 130 )
59
- self .assertGreater (len (res ), 90 )
60
-
61
- with self .subTest ("strict handling of cache coordinates" ):
62
- with self .recorder .use_cassette ("geocaching_quick_strictness" ):
63
- res = list (self .gc .search_quick (rect , strict = True ))
64
- self .assertLess (len (res ), expected_cache_num + tolerance )
65
- self .assertGreater (len (res ), expected_cache_num - tolerance )
66
-
67
- with self .subTest ("larger zoom - more precise" ):
68
- with self .recorder .use_cassette ("geocaching_quick_zoom" ):
69
- res1 = list (self .gc .search_quick (rect , strict = True , zoom = 15 ))
70
- res2 = list (self .gc .search_quick (rect , strict = True , zoom = 14 ))
71
- for res in res1 , res2 :
72
- self .assertLess (len (res ), expected_cache_num + tolerance )
73
- self .assertGreater (len (res ), expected_cache_num - tolerance )
74
- for c1 , c2 in itertools .product (res1 , res2 ):
75
- self .assertLess (c1 .location .precision , c2 .location .precision )
76
-
77
- @unittest .expectedFailure
78
- def test_search_quick_match_load (self ):
79
- """Test if quick search results matches exact cache locations."""
80
- rect = Rectangle (Point (49.73 , 13.38 ), Point (49.74 , 13.39 ))
81
- with self .recorder .use_cassette ("geocaching_matchload" ):
82
- # at commit time, this test is an allowed failure. Once this feature is fixed, the
83
- # corresponding cassette will have to be deleted and re-recorded.
84
- caches = list (self .gc .search_quick (rect , strict = True , zoom = 15 ))
85
- for cache in caches :
86
- try :
87
- cache .load ()
88
- self .assertIn (cache .location , rect )
89
- except PMOnlyException :
90
- pass
46
+ with self .recorder .use_cassette ("geocaching_quick_search" ):
47
+ res = [c .wp for c in self .gc .search_quick (rect )]
48
+ for wp in ["GC11PRW" , "GC161KR" , "GC167Y7" ]:
49
+ self .assertIn (wp , res )
50
+ self .assertEqual (len (res ), 11 )
91
51
92
52
def test__try_getting_cache_from_guid (self ):
93
53
# get "normal" cache from guidpage
0 commit comments