def testToLogInfoStructNoDNS(self):
     log = {
         "key": "YWJj",
         "description": "Test Description",
         "url": "ct.example.com",
     }
     expected_loginfo = (
         '    {"\\x61\\x62\\x63",\n     3,\n     "Test Description"}')
     self.assertEqual(make_ct_known_logs_list._to_loginfo_struct(log),
                      expected_loginfo)
 def testToLogInfoStruct(self):
     log = {"key": "YWJj",
            "description": "Test Description",
            "url": "ct.example.com",
            "dns_api_endpoint": "dns.ct.example.com"}
     expected_loginfo = (
             '    {"\\x61\\x62\\x63",\n     3,\n     "Test Description",\n'
             '     "https://ct.example.com",\n     "dns.ct.example.com"}')
     self.assertEqual(
             make_ct_known_logs_list._to_loginfo_struct(log),
             expected_loginfo)
 def testToLogInfoStruct(self):
     log = {"key": "YWJj",
            "description": "Test Description",
            "url": "ct.example.com",
            "dns_api_endpoint": "dns.ct.example.com"}
     expected_loginfo = (
             '    {"\\x61\\x62\\x63",\n     3,\n     "Test Description",\n'
             '     "https://ct.example.com",\n     "dns.ct.example.com"}')
     self.assertEqual(
             make_ct_known_logs_list._to_loginfo_struct(log),
             expected_loginfo)
Ejemplo n.º 4
0
 def testToLogInfoStruct(self):
     log = {
         "key": "YWJj",
         "description": "Test Description",
         "url": "ct.example.com",
         "dns": "dns.ct.example.com"
     }
     expected_loginfo = (
         '    {"\\x61\\x62\\x63",\n     3,\n     "Test Description",\n     "",'
         '\n     nullptr, 0}')
     self.assertEqual(make_ct_known_logs_list._to_loginfo_struct(log, 1),
                      expected_loginfo)
Ejemplo n.º 5
0
 def testToLogInfoStructWithCurrentOperator(self):
     log = {
         "key": "YWJj",
         "description": "Test Description",
         "url": "ct.example.com",
         "dns": "dns.ct.example.com"
     }
     # This is added separately instead of included in the json since it is done
     # separately in the generation flow too.
     log["current_operator"] = "Test Operator"
     expected_loginfo = (
         '    {"\\x61\\x62\\x63",\n     3,\n     "Test Description",\n'
         '     "Test Operator",\n     nullptr, 0}')
     self.assertEqual(make_ct_known_logs_list._to_loginfo_struct(log, 1),
                      expected_loginfo)