@@ -54,11 +54,6 @@ class Route53ChangedDoesNotExist(unittest.TestCase):
54
54
@patch ('plugins.route53.urllib2' )
55
55
def test_run (self , mock_urllib2 ):
56
56
import re
57
- does_not_exist_regexes = [
58
- re .compile (r"NoSuchBucket|NoSuchKey|NoSuchVersion" ), # NoSuch error messages from S3
59
- re .compile (r"[Ee]xpir(ed|y|es)" ), # expiry messages
60
- re .compile (r"not exists?" ) # generic does not exist
61
- ]
62
57
63
58
def mocked_get_location_content (location , * args , ** kwargs ):
64
59
if location == "https://prezi.com/nosuch1" :
@@ -69,12 +64,12 @@ def mocked_get_location_content(location, *args, **kwargs):
69
64
return MagicMock (read = MagicMock (side_effect = lambda : "this page does not exist" ))
70
65
71
66
mock_urllib2 .urlopen = MagicMock (side_effect = mocked_get_location_content )
72
- results = list (page_process_for_route53changed ('https://prezi.com/nosuch1' , does_not_exist_regexes ))
73
- self .assertEquals (set ( ['NoSuchBucket|NoSuchKey|NoSuchVersion' ]) , results [1 ]["matches" ])
74
- results = list (page_process_for_route53changed ('https://meh.prezi.com' , does_not_exist_regexes ))
75
- self .assertEquals (set ([]) , results [1 ]["matches" ])
76
- results = list (page_process_for_route53changed ('https://my404.prezi.com' , does_not_exist_regexes ))
77
- self .assertEquals (set ( ["not exists?" ]) , results [1 ]["matches" ])
67
+ results = list (page_process_for_route53changed ('https://prezi.com/nosuch1' ))
68
+ self .assertEquals (['NoSuchBucket|NoSuchKey|NoSuchVersion' ], results [1 ]["matches" ])
69
+ results = list (page_process_for_route53changed ('https://meh.prezi.com' ))
70
+ self .assertEquals ([] , results [1 ]["matches" ])
71
+ results = list (page_process_for_route53changed ('https://my404.prezi.com' ))
72
+ self .assertEquals (["not exists?" ], results [1 ]["matches" ])
78
73
79
74
80
75
def main ():
0 commit comments