Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: sitescripts/extensions/test/test_createNightlies.py

Issue 29375570: Issue 4880 - Change create nightlies test_copy_repository to use set (Closed) Base URL: https://hg.adblockplus.org/sitescripts
Patch Set: Created Feb. 13, 2017, 11:11 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # This file is part of the Adblock Plus web scripts, 1 # This file is part of the Adblock Plus web scripts,
2 # Copyright (C) 2006-2016 Eyeo GmbH 2 # Copyright (C) 2006-2016 Eyeo GmbH
3 # 3 #
4 # Adblock Plus is free software: you can redistribute it and/or modify 4 # Adblock Plus is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License version 3 as 5 # it under the terms of the GNU General Public License version 3 as
6 # published by the Free Software Foundation. 6 # published by the Free Software Foundation.
7 # 7 #
8 # Adblock Plus is distributed in the hope that it will be useful, 8 # Adblock Plus is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 49
50 def test_current_revision(nightlybuild): 50 def test_current_revision(nightlybuild):
51 # The hash is the commit that the safari bookmark points to. 51 # The hash is the commit that the safari bookmark points to.
52 # (see adblockplusnightly.bookmark in test/data/bookmarks) 52 # (see adblockplusnightly.bookmark in test/data/bookmarks)
53 assert nightlybuild.revision == '1291590ddd0f' 53 assert nightlybuild.revision == '1291590ddd0f'
54 54
55 55
56 def test_copy_repository(nightlybuild, nightlydir): 56 def test_copy_repository(nightlybuild, nightlydir):
57 nightlybuild.copyRepository() 57 nightlybuild.copyRepository()
58 assert os.listdir(nightlybuild.tempdir) == ['.hg', 'README.txt'] 58 files = os.listdir(nightlybuild.tempdir)
59 assert set(files) == {'.hg', 'README.txt'}
59 60
60 61
61 def test_get_changes(nightlybuild, nightlydir): 62 def test_get_changes(nightlybuild, nightlydir):
62 # The bookmark 'safari' contains only 2 revisions 63 # The bookmark 'safari' contains only 2 revisions
63 # default contains 51 so here we ensure that erroneous changes 64 # default contains 51 so here we ensure that erroneous changes
64 # are not returned 65 # are not returned
65 for change in nightlybuild.getChanges(): 66 for change in nightlybuild.getChanges():
66 assert change['revision'] < '2' 67 assert change['revision'] < '2'
67 68
68 nightlybuild.config.revision = 'default' 69 nightlybuild.config.revision = 'default'
69 for change in nightlybuild.getChanges(): 70 for change in nightlybuild.getChanges():
70 assert change['revision'] > '1' 71 assert change['revision'] > '1'
71 72
72 73
73 def test_missing_bookmark(config): 74 def test_missing_bookmark(config):
74 config.revision = 'foo' 75 config.revision = 'foo'
75 config.type = 'type' 76 config.type = 'type'
76 try: 77 try:
77 createNightlies.NightlyBuild(config) 78 createNightlies.NightlyBuild(config)
78 except CalledProcessError as e: 79 except CalledProcessError as e:
79 assert e.returncode == 255 80 assert e.returncode == 255
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld