Skip to content
This repository was archived by the owner on Mar 19, 2025. It is now read-only.

Commit 687b19f

Browse files
author
György Demarcsek
committed
fixing unit tests for route53 plugin
1 parent fd356fa commit 687b19f

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

tests/plugins/test_route53.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ class Route53ChangedDoesNotExist(unittest.TestCase):
5454
@patch('plugins.route53.urllib2')
5555
def test_run(self, mock_urllib2):
5656
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-
]
6257

6358
def mocked_get_location_content(location, *args, **kwargs):
6459
if location == "https://prezi.com/nosuch1":
@@ -69,12 +64,12 @@ def mocked_get_location_content(location, *args, **kwargs):
6964
return MagicMock(read=MagicMock(side_effect=lambda: "this page does not exist"))
7065

7166
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"])
7873

7974

8075
def main():

0 commit comments

Comments
 (0)