コード例 #1
0
 def test_BridgeMeasurementComparison(self):
     m1 = Storage.BridgeMeasurement(0, "", "", "", "", "", "", "",
                                    "2020-06-17", 0)
     m2 = Storage.BridgeMeasurement(0, "", "", "", "", "", "", "",
                                    "2020-06-18", 0)
     self.assertTrue(m2.newerThan(m1))
     self.assertFalse(m1.newerThan(m2))
     self.assertFalse(m1.newerThan(m1))
コード例 #2
0
 def test_BridgeMeasurementCompact(self):
     m = Storage.BridgeMeasurement(0, "FINGERPRINT", "obfs4", "1.2.3.4",
                                   "1234", "ru", "1234", "ooni",
                                   "2020-06-17", 0)
     self.assertEquals(m.compact(), ("ru", "1.2.3.4", "1234"))