def test_save_region_certificate(self): cert = security.generate_region_certificate() security.save_region_certificate(cert) self.assertEqual( cert.dumpPEM().decode("ascii"), Config.objects.get_config("rpc_region_certificate"), )
def test_get_region_certificate(self): cert = security.generate_region_certificate() security.save_region_certificate(cert) self.assertEqual(cert, security.get_region_certificate())
def test_load_region_certificate(self): cert = security.generate_region_certificate() Config.objects.set_config( "rpc_region_certificate", cert.dumpPEM().decode("ascii") ) self.assertEqual(cert, security.load_region_certificate())
def test_generate_region_certificate(self): serial = self.patch_serial() cert = security.generate_region_certificate() self.assertThat(cert, is_valid_region_certificate) self.assertEqual(serial, cert.serialNumber())