def test_utcid_from_utctime(self): """Test utcid() returns utcid corresponding to utctime parameter.""" utctime = Utility.utctime() utcid = Utility.utcid(utctime) assert isinstance(utcid, str), 'utcid is not a string' assert utctime == Utility.utctime( utcid), 'utctime -> utcid -> utctime conversion fails'
def handlerunnode(self, runnode, runid): """Extracts generic data for the given run. Keyword arguments: runnode -- An Extract.Node for the run. runid -- A UTC ID string which identifies the run. Example of nodes added to the run node: <core> <id>2007-06-22_13.17.51</id> <start-time>2007/06/22 13:17:51</start-time> <extract-time>2007/06/22 13:18:55</extract-time> </core> All nodes are guaranteed to be present. All times are in UTC. """ corenode = runnode.addnode('core') corenode.addnode('id', runid) corenode.addnode('start-time', Utility.utctime(runid)) corenode.addnode('extract-time', Utility.utctime())
def test_utctime_from_utcid(self): """Test utctime() returns utctime corresponding to utcid parameter.""" utcid = Utility.utcid() utctime = Utility.utctime(utcid) assert isinstance(utctime, str), 'utctime is not a string' assert utcid == Utility.utcid(utctime), 'utcid -> utctime -> utcid conversion fails'
def test_utctime(self): """Test utctime() returns a string value when no parameter.""" utctime = Utility.utctime() assert isinstance(utctime, str), 'utctime is not a string'