]> scripts.mit.edu Git - wizard.git/blob - wizard/tests/old_log_test.py
Partition on colon for exceptions, ignore blank blacklistings.
[wizard.git] / wizard / tests / old_log_test.py
1 import os.path
2 from dateutil.tz import tzoffset
3 from datetime import datetime
4
5 from wizard import app, deploy, old_log
6
7 def getTestFile(file):
8     return os.path.join(os.path.dirname(os.path.abspath(__file__)), file)
9
10 def test_deploy_log_load():
11     # this also is test_deploy_source_parse() and test_application_version_parse()
12     dlog = old_log.DeployLog.load(deploy.Deployment(getTestFile("old_log_test")))
13
14     assert dlog[0].datetime == datetime(2006, 3, 23, 10, 7, 40, tzinfo=tzoffset(None, -5 * 60 * 60))
15     assert dlog[0].user == "unknown"
16     assert isinstance(dlog[0].source, old_log.TarballInstall)
17     assert dlog[0].source.location == "/afs/athena.mit.edu/contrib/scripts/deploy/mediawiki.tar.gz"
18     assert dlog[0].source.isDev == False
19     assert dlog[0].version == app.applications()["mediawiki"].makeVersion('1.5.6')
20
21     assert dlog[1].datetime == datetime(2007, 10, 17, 3, 38, 2, tzinfo=tzoffset(None, -4 * 60 * 60))
22     assert dlog[1].user == "quentin@QUICHE-LORRAINE.MIT.EDU"
23     assert isinstance(dlog[1].source, old_log.OldUpdate)
24     assert dlog[1].source.isDev == True
25     assert dlog[1].version == app.applications()["mediawiki"].makeVersion('1.5.6')
26