-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdotnetrc.tests.py
executable file
·491 lines (481 loc) · 21.3 KB
/
dotnetrc.tests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
#! /usr/bin/env python3
from typing import Optional
import os
import sys
import unittest
import tempfile
import os.path as path
import subprocess
from fnmatch import fnmatchcase as fnmatch
from urllib.parse import urlparse
import dotnetrc
import logging
logg = logging.getLogger("TEST")
url_div = "https://pforgeipt.intra"
url_k8s = "https://k8s.pforgeipt-docker.intra"
dev_div = "https://dev.pforgeipt.intra"
dev_k8s = "https://devk8s.pforgeipt-docker.intra"
TEMP_NETRC: Optional[str] = None
def netloc(url: str) -> str:
return urlparse(url).netloc
class netcTest(unittest.TestCase):
def netrc(self) -> str:
return TEMP_NETRC or "/dev/null"
def setUp(self) -> None:
logg.info("setUp")
global TEMP_NETRC
F, TEMP_NETRC = tempfile.mkstemp(suffix=".netrc")
assert TEMP_NETRC
dotnetrc.NETRC_FILENAMES = [TEMP_NETRC]
logg.info("netrc -> %s", dotnetrc.NETRC_FILENAMES)
os.environ["USER"] = "testuser"
def tearDown(self) -> None:
logg.info("tearDown")
global TEMP_NETRC
if TEMP_NETRC and path.exists(TEMP_NETRC):
os.unlink(TEMP_NETRC)
TEMP_NETRC = None
dotnetrc.NETRC_OVERRIDE = {}
dotnetrc.NETRC_USERNAME = ""
dotnetrc.NETRC_PASSWORD = ""
dotnetrc.NETRC_CLEARTEXT = True
def test_034(self) -> None:
obf = dotnetrc._encode64("your text")
self.assertEqual(obf, 'eW91ciB0ZXh0')
txt = dotnetrc._decode64(obf)
self.assertEqual(txt, "your text")
def test_035(self) -> None:
obf = dotnetrc._encode46("your text")
self.assertEqual(obf, '0hXZ0Bic19We')
txt = dotnetrc._decode46(obf)
self.assertEqual(txt, "your text")
def test_036(self) -> None:
obf = dotnetrc._encode36("your text")
self.assertEqual(obf, '0uKM0Ovp19Jr')
txt = dotnetrc._decode36(obf)
self.assertEqual(txt, "your text")
def test_037(self) -> None:
obf = dotnetrc._encode63("your text")
self.assertEqual(obf, 'rJ91pvO0MKu0')
txt = dotnetrc._decode63(obf)
self.assertEqual(txt, "your text")
def test_040(self) -> None:
us, pw = dotnetrc.get_username_password(url_div)
self.assertEqual(us, "testuser")
self.assertEqual(pw, "")
def test_050(self) -> None:
dotnetrc.set_username_password("abc", "xyz")
us, pw = dotnetrc.get_username_password(url_div)
self.assertEqual(us, "abc")
self.assertEqual(pw, "xyz")
def test_051(self) -> None:
dotnetrc.set_username_password("abc", "xyz")
us, pw = dotnetrc.get_username_password(url_k8s)
self.assertEqual(us, "abc")
self.assertEqual(pw, "xyz")
def test_052(self) -> None:
dotnetrc.set_username_password("abc", "xyz")
dotnetrc.set_username_password("abc", "uvw")
us, pw = dotnetrc.get_username_password(url_div)
self.assertEqual(us, "abc")
self.assertEqual(pw, "uvw")
def test_060(self) -> None:
dotnetrc.set_username_password("abc", "xyz")
dotnetrc.set_username_password("abc", "uvw")
dotnetrc.add_username_password("abc", "123", url_div)
us, pw = dotnetrc.get_username_password(url_div)
self.assertEqual(us, "abc")
self.assertEqual(pw, "123")
us, pw = dotnetrc.get_username_password(url_k8s)
self.assertEqual(us, "abc")
self.assertEqual(pw, "uvw")
def test_061(self) -> None:
dotnetrc.set_username_password("abc", "xyz")
dotnetrc.set_username_password("abc", "uvw")
dotnetrc.add_username_password("abc", "123", url_div)
us, pw = dotnetrc.get_username_password(url_div)
self.assertEqual(us, "abc")
self.assertEqual(pw, "123")
us, pw = dotnetrc.get_username_password(url_k8s)
self.assertEqual(us, "abc")
self.assertEqual(pw, "uvw")
#
dotnetrc.set_username_password("abc", "pqr")
dotnetrc.add_username_password("abc", "345", url_div)
us, pw = dotnetrc.get_username_password(url_div)
self.assertEqual(us, "abc")
self.assertEqual(pw, "345")
us, pw = dotnetrc.get_username_password(url_k8s)
self.assertEqual(us, "abc")
self.assertEqual(pw, "pqr")
def test_201(self) -> None:
dotnetrc.set_username_password("abc", "xyz")
dotnetrc.set_username_password("abc", "uvw")
with open(self.netrc(), "w") as f:
f.write(f"https://foo:pqr@{netloc(url_div)}")
us, pw = dotnetrc.get_username_password(url_div)
self.assertEqual(us, "foo")
self.assertEqual(pw, "pqr")
us, pw = dotnetrc.get_username_password(url_k8s)
self.assertEqual(us, "abc")
self.assertEqual(pw, "uvw")
def test_211(self) -> None:
dotnetrc.set_username_password("abc", "xyz")
dotnetrc.set_username_password("abc", "uvw")
with open(self.netrc(), "w") as f:
f.write(f"https://foo:pqr@*.intra")
us, pw = dotnetrc.get_username_password(url_div)
self.assertEqual(us, "foo")
self.assertEqual(pw, "pqr")
us, pw = dotnetrc.get_username_password(url_k8s)
self.assertEqual(us, "foo")
self.assertEqual(pw, "pqr")
def test_221(self) -> None:
dotnetrc.set_username_password("abc", "xyz")
dotnetrc.set_username_password("abc", "uvw")
with open(self.netrc(), "w") as f:
f.write(f"https://foo:pqr@{netloc(url_div)}\n")
f.write(f"https://foo:ijk@*.intra\n")
us, pw = dotnetrc.get_username_password(url_div)
self.assertEqual(us, "foo")
self.assertEqual(pw, "pqr")
us, pw = dotnetrc.get_username_password(url_k8s)
self.assertEqual(us, "foo")
self.assertEqual(pw, "ijk")
def test_231(self) -> None:
dotnetrc.set_username_password("abc", "xyz")
dotnetrc.set_username_password("abc", "uvw")
with open(self.netrc(), "w") as f:
f.write(f"https://foo:pqr@{netloc(url_div)}\n")
f.write(f"https://foo:ijk@*.intra\n")
us, pw = dotnetrc.get_username_password(url_div)
self.assertEqual(us, "foo")
self.assertEqual(pw, "pqr")
us, pw = dotnetrc.get_username_password(url_k8s)
self.assertEqual(us, "foo")
self.assertEqual(pw, "ijk")
def test_301(self) -> None:
dotnetrc.set_username_password("abc", "xyz")
dotnetrc.set_username_password("abc", "uvw")
with open(self.netrc(), "w") as f:
f.write(f"machine {netloc(url_div)} login foo password pqr")
us, pw = dotnetrc.get_username_password(url_div)
self.assertEqual(us, "foo")
self.assertEqual(pw, "pqr")
us, pw = dotnetrc.get_username_password(url_k8s)
self.assertEqual(us, "abc")
self.assertEqual(pw, "uvw")
def test_311(self) -> None:
dotnetrc.set_username_password("abc", "xyz")
dotnetrc.set_username_password("abc", "uvw")
with open(self.netrc(), "w") as f:
f.write(f"machine *.intra login foo password pqr")
us, pw = dotnetrc.get_username_password(url_div)
self.assertEqual(us, "foo")
self.assertEqual(pw, "pqr")
us, pw = dotnetrc.get_username_password(url_k8s)
self.assertEqual(us, "foo")
self.assertEqual(pw, "pqr")
def test_312(self) -> None:
dotnetrc.set_username_password("abc", "xyz")
dotnetrc.set_username_password("abc", "uvw")
with open(self.netrc(), "w") as f:
f.write(f"machine *.intra password pqr")
us, pw = dotnetrc.get_username_password(url_div)
self.assertEqual(us, "abc")
self.assertEqual(pw, "pqr")
us, pw = dotnetrc.get_username_password(url_k8s)
self.assertEqual(us, "abc")
self.assertEqual(pw, "pqr")
def test_313(self) -> None:
with open(self.netrc(), "w") as f:
f.write(f"machine *.intra password pqr")
us, pw = dotnetrc.get_username_password(url_div)
self.assertEqual(us, "testuser")
self.assertEqual(pw, "pqr")
us, pw = dotnetrc.get_username_password(url_k8s)
self.assertEqual(us, "testuser")
self.assertEqual(pw, "pqr")
def test_316(self) -> None:
with open(self.netrc(), "w") as f:
f.write(f"machine *.intra password64 cHFy")
us, pw = dotnetrc.get_username_password(url_div)
self.assertEqual(us, "testuser")
self.assertEqual(pw, "pqr")
us, pw = dotnetrc.get_username_password(url_k8s)
self.assertEqual(us, "testuser")
self.assertEqual(pw, "pqr")
def test_317(self) -> None:
with open(self.netrc(), "w") as f:
f.write(f"machine *.intra password46 yFHc")
us, pw = dotnetrc.get_username_password(url_div)
self.assertEqual(us, "testuser")
self.assertEqual(pw, "pqr")
us, pw = dotnetrc.get_username_password(url_k8s)
self.assertEqual(us, "testuser")
self.assertEqual(pw, "pqr")
def test_318(self) -> None:
with open(self.netrc(), "w") as f:
f.write(f"machine *.intra password36 lSUp")
us, pw = dotnetrc.get_username_password(url_div)
self.assertEqual(us, "testuser")
self.assertEqual(pw, "pqr")
us, pw = dotnetrc.get_username_password(url_k8s)
self.assertEqual(us, "testuser")
self.assertEqual(pw, "pqr")
def test_319(self) -> None:
with open(self.netrc(), "w") as f:
f.write(f"machine *.intra password63 pUSl")
us, pw = dotnetrc.get_username_password(url_div)
self.assertEqual(us, "testuser")
self.assertEqual(pw, "pqr")
us, pw = dotnetrc.get_username_password(url_k8s)
self.assertEqual(us, "testuser")
self.assertEqual(pw, "pqr")
def test_321(self) -> None:
dotnetrc.set_username_password("abc", "xyz")
dotnetrc.set_username_password("abc", "uvw")
with open(self.netrc(), "w") as f:
f.write(f"machine {netloc(url_div)} login foo password pqr\n")
f.write(f"machine *.intra login foo password ijk\n")
us, pw = dotnetrc.get_username_password(url_div)
self.assertEqual(us, "foo")
self.assertEqual(pw, "pqr")
us, pw = dotnetrc.get_username_password(url_k8s)
self.assertEqual(us, "foo")
self.assertEqual(pw, "ijk")
def test_322(self) -> None:
dotnetrc.set_username_password("abc", "xyz")
dotnetrc.set_username_password("abc", "uvw")
with open(self.netrc(), "w") as f:
f.write(f"machine {netloc(url_div)} password pqr\n")
f.write(f"machine *.intra password ijk\n")
us, pw = dotnetrc.get_username_password(url_div)
self.assertEqual(us, "abc")
self.assertEqual(pw, "pqr")
us, pw = dotnetrc.get_username_password(url_k8s)
self.assertEqual(us, "abc")
self.assertEqual(pw, "ijk")
def test_323(self) -> None:
with open(self.netrc(), "w") as f:
f.write(f"machine {netloc(url_div)} password pqr\n")
f.write(f"machine *.intra password ijk\n")
us, pw = dotnetrc.get_username_password(url_div)
self.assertEqual(us, "testuser")
self.assertEqual(pw, "pqr")
us, pw = dotnetrc.get_username_password(url_k8s)
self.assertEqual(us, "testuser")
self.assertEqual(pw, "ijk")
def test_331(self) -> None:
dotnetrc.set_username_password("abc", "xyz")
dotnetrc.set_username_password("abc", "uvw")
with open(self.netrc(), "w") as f:
f.write(f"machine {netloc(url_div)} \n login foo \npassword pqr\n")
f.write(f"machine *.intra \n login foo \npassword ijk\n")
us, pw = dotnetrc.get_username_password(url_div)
self.assertEqual(us, "foo")
self.assertEqual(pw, "pqr")
us, pw = dotnetrc.get_username_password(url_k8s)
self.assertEqual(us, "foo")
self.assertEqual(pw, "ijk")
def test_332(self) -> None:
dotnetrc.set_username_password("abc", "xyz")
dotnetrc.set_username_password("abc", "uvw")
with open(self.netrc(), "w") as f:
f.write(f"machine {netloc(url_div)} \n password pqr\n")
f.write(f"machine *.intra \n password ijk\n")
us, pw = dotnetrc.get_username_password(url_div)
self.assertEqual(us, "abc")
self.assertEqual(pw, "pqr")
us, pw = dotnetrc.get_username_password(url_k8s)
self.assertEqual(us, "abc")
self.assertEqual(pw, "ijk")
def test_333(self) -> None:
with open(self.netrc(), "w") as f:
f.write(f"machine {netloc(url_div)} \n password pqr\n")
f.write(f"machine *.intra \n password ijk\n")
us, pw = dotnetrc.get_username_password(url_div)
self.assertEqual(us, "testuser")
self.assertEqual(pw, "pqr")
us, pw = dotnetrc.get_username_password(url_k8s)
self.assertEqual(us, "testuser")
self.assertEqual(pw, "ijk")
def test_421(self) -> None:
dotnetrc.set_username_password("abc", "xyz")
dotnetrc.set_username_password("abc", "uvw")
with open(self.netrc(), "w") as f:
f.write(f"machine {netloc(url_div)} login foo password pqr\n")
f.write(f"machine {netloc(url_k8s)} alias {netloc(url_div)}\n")
f.write(f"machine *.intra password ijk\n")
us, pw = dotnetrc.get_username_password(url_div)
self.assertEqual(us, "foo")
self.assertEqual(pw, "pqr")
us, pw = dotnetrc.get_username_password(url_k8s)
self.assertEqual(us, "foo")
self.assertEqual(pw, "pqr") # not "ijk"
def test_422(self) -> None:
dotnetrc.set_username_password("abc", "xyz")
dotnetrc.set_username_password("abc", "uvw")
with open(self.netrc(), "w") as f:
f.write(f"machine {netloc(url_div)} password pqr\n")
f.write(f"machine {netloc(url_k8s)} alias {netloc(url_div)}\n")
f.write(f"machine *.intra password ijk\n")
us, pw = dotnetrc.get_username_password(url_div)
self.assertEqual(us, "abc")
self.assertEqual(pw, "pqr")
us, pw = dotnetrc.get_username_password(url_k8s)
self.assertEqual(us, "abc")
self.assertEqual(pw, "pqr") # not "ijk"
def test_423(self) -> None:
with open(self.netrc(), "w") as f:
f.write(f"machine {netloc(url_div)} password pqr\n")
f.write(f"machine {netloc(url_k8s)} alias {netloc(url_div)}\n")
f.write(f"machine *.intra password ijk\n")
us, pw = dotnetrc.get_username_password(url_div)
self.assertEqual(us, "testuser")
self.assertEqual(pw, "pqr")
us, pw = dotnetrc.get_username_password(url_k8s)
self.assertEqual(us, "testuser")
self.assertEqual(pw, "pqr") # not "ijk"
def test_431(self) -> None:
dotnetrc.set_username_password("abc", "xyz")
dotnetrc.set_username_password("abc", "uvw")
with open(self.netrc(), "w") as f:
f.write(f"machine {netloc(dev_div)} login foo password pqr\n")
f.write(f"machine {netloc(dev_k8s)} alias {netloc(dev_div)}\n")
f.write(f"machine *.intra password ijk\n")
us, pw = dotnetrc.get_username_password(dev_div)
self.assertEqual(us, "foo")
self.assertEqual(pw, "pqr")
us, pw = dotnetrc.get_username_password(dev_k8s)
self.assertEqual(us, "foo")
self.assertEqual(pw, "pqr") # not "ijk"
def test_432(self) -> None:
dotnetrc.set_username_password("abc", "xyz")
dotnetrc.set_username_password("abc", "uvw")
with open(self.netrc(), "w") as f:
f.write(f"machine {netloc(dev_div)} password pqr\n")
f.write(f"machine {netloc(dev_k8s)} alias {netloc(dev_div)}\n")
f.write(f"machine *.intra password ijk\n")
us, pw = dotnetrc.get_username_password(dev_div)
self.assertEqual(us, "abc")
self.assertEqual(pw, "pqr")
us, pw = dotnetrc.get_username_password(dev_k8s)
self.assertEqual(us, "abc")
self.assertEqual(pw, "pqr") # not "ijk"
def test_433(self) -> None:
with open(self.netrc(), "w") as f:
f.write(f"machine {netloc(dev_div)} password pqr\n")
f.write(f"machine {netloc(dev_k8s)} alias {netloc(dev_div)}\n")
f.write(f"machine *.intra password ijk\n")
us, pw = dotnetrc.get_username_password(dev_div)
self.assertEqual(us, "testuser")
self.assertEqual(pw, "pqr")
us, pw = dotnetrc.get_username_password(dev_k8s)
self.assertEqual(us, "testuser")
self.assertEqual(pw, "pqr") # not "ijk"
def test_901(self) -> None:
cmd = ["./dotnetrc.py", "help"]
out = subprocess.check_output(cmd)
logg.info("OUT:\n%s", out)
self.assertIn(b"x", out)
def test_902(self) -> None:
filename = dotnetrc.NETRC_FILENAMES[0]
cmd = ["./dotnetrc.py", "help"]
out = subprocess.check_output(cmd)
logg.info("OUT:\n%s", out)
self.assertIn(b"x", out)
def test_903(self) -> None:
filename = dotnetrc.NETRC_FILENAMES[0]
cmd = ["./dotnetrc.py", "help", "--netcredentials", filename]
out = subprocess.check_output(cmd)
logg.info("OUT:\n%s", out)
self.assertIn(b"x", out)
def test_910(self) -> None:
filename = dotnetrc.NETRC_FILENAMES[0]
cmd = ["./dotnetrc.py", "--netcredentials", filename, "get", "extra.example"]
out = subprocess.check_output(cmd)
logg.info("OUT:\n%s", out)
self.assertIn(b"host=extra", out)
self.assertIn(b"username=testuser", out)
self.assertNotIn(b"password=", out)
def test_911(self) -> None:
filename = dotnetrc.NETRC_FILENAMES[0]
cmd = ["./dotnetrc.py", "--netcredentials", filename, "store", "extra.example", "someuser", "somepass"]
out = subprocess.check_output(cmd)
logg.info("OUT:\n%s", out)
self.assertIn(b"written to", out)
cmd = ["./dotnetrc.py", "--netcredentials", filename, "get", "extra.example"]
out = subprocess.check_output(cmd)
logg.info("OUT:\n%s", out)
self.assertIn(b"host=extra", out)
self.assertIn(b"username=someuser", out)
self.assertIn(b"password=somepass", out)
def test_912(self) -> None:
filename = dotnetrc.NETRC_FILENAMES[0]
cmd = ["./dotnetrc.py", "--netcredentials", filename, "store", "extra.example", "someuser", "somepass"]
out = subprocess.check_output(cmd)
logg.info("OUT:\n%s", out)
self.assertIn(b"written to", out)
cmd = ["./dotnetrc.py", "--netcredentials", filename, "get", "extra.example"]
out = subprocess.check_output(cmd)
logg.info("OUT:\n%s", out)
self.assertIn(b"host=extra", out)
self.assertIn(b"username=someuser", out)
self.assertIn(b"password=somepass", out)
cmd = ["./dotnetrc.py", "--netcredentials", filename, "erase", "extra.example"]
out = subprocess.check_output(cmd)
logg.info("OUT:\n%s", out)
self.assertIn(b"erased in", out)
cmd = ["./dotnetrc.py", "--netcredentials", filename, "get", "extra.example"]
out = subprocess.check_output(cmd)
logg.info("OUT:\n%s", out)
self.assertIn(b"host=extra", out)
self.assertIn(b"username=testuser", out)
self.assertNotIn(b"password=", out)
if __name__ == "__main__":
# logging.basicConfig(level=("-v" not in sys.argv and logging.WARNING or logging.INFO))
# dotnetrc.netrc_logg.setLevel(("-v" not in sys.argv and logging.INFO or logging.DEBUG))
# unittest.main()
from optparse import OptionParser
cmdline = OptionParser("%prog [n_]test...")
cmdline.add_option("-v", "--verbose", action="count", default=0, help="more verbose logging")
cmdline.add_option("-^", "--quiet", action="count", default=0, help="less verbose logging")
cmdline.add_option("--failfast", action="store_true", default=False,
help="Stop the test run on the first error or failure. [%default]")
cmdline.add_option("--xmlresults", metavar="FILE", default=None,
help="capture results as a junit xml file [%default]")
opt, args = cmdline.parse_args()
logging.basicConfig(level=max(0, logging.WARNING - 10 * opt.verbose + 10 * opt.quiet))
dotnetrc.netrc_logg.setLevel(max(0, logging.INFO - 10 * opt.verbose + 10 * opt.quiet))
if not args:
args = ["test_*"]
suite = unittest.TestSuite()
for arg in args:
if len(arg) > 2 and arg[0].isalpha() and arg[1] == "_":
arg = "test_" + arg[2:]
for classname in sorted(globals()):
if not classname.endswith("Test"):
continue
testclass = globals()[classname]
for method in sorted(dir(testclass)):
if "*" not in arg: arg += "*"
if arg.startswith("_"): arg = arg[1:]
if fnmatch(method, arg):
suite.addTest(testclass(method))
# running
xmlresults = None
if opt.xmlresults:
if os.path.exists(opt.xmlresults):
os.remove(opt.xmlresults)
xmlresults = open(opt.xmlresults, "wb")
if xmlresults:
import xmlrunner # type: ignore[import]
Runner = xmlrunner.XMLTestRunner
result = Runner(xmlresults).run(suite)
logg.info(" XML reports written to %s", opt.xmlresults)
else:
Runner = unittest.TextTestRunner
result = Runner(verbosity=opt.verbose, failfast=opt.failfast).run(suite)
if not result.wasSuccessful():
sys.exit(1)