def testToUrlObjectNoHash(self): 'Test that we can make a UrlObject out of this Scan object withn no hash.' url = 'http://www.gourmetcheese.com/jackofalltrades.aspx' type = 'local' malicious = False scan = Scan(self.owner, type, url, malicious, self.siginfo) scan.filesize = 35432 expected = UrlObject(url, 35432, nonce=self.owner.name) actual = scan.to_UrlObject() self.assertEqual(expected, actual)
def testToUrlObject(self): 'Test that we can make a UrlObject out of this Scan object.' url = 'http://www.gourmetcheese.com/jackofalltrades.aspx' type = 'local' malicious = False scan = Scan(self.owner, type, url, malicious, self.siginfo) scan.filesize = 35980 scan.hash = 'ea46fc3db21ae' expected = UrlObject(url, 35980, nonce=self.owner.name, hash='ea46fc3db21ae') actual = scan.to_UrlObject() self.assertEqual(expected, actual)