def testAccessors(self): """Test for KeyInfo accessors""" self.key_info.key_name.append( ds.key_name_from_string(ds_data.TEST_KEY_NAME)) self.key_info.key_value.append( ds.key_value_from_string(ds_data.TEST_KEY_VALUE1)) self.key_info.retrieval_method.append( ds.retrieval_method_from_string(ds_data.TEST_RETRIEVAL_METHOD)) self.key_info.x509_data.append( ds.x509_data_from_string(ds_data.TEST_X509_DATA)) self.key_info.pgp_data.append( ds.pgp_data_from_string(ds_data.TEST_PGP_DATA)) self.key_info.spki_data.append( ds.spki_data_from_string(ds_data.TEST_SPKI_DATA)) self.key_info.mgmt_data.append( ds.mgmt_data_from_string(ds_data.TEST_MGMT_DATA)) self.key_info.id = "id" new_key_info = ds.key_info_from_string(self.key_info.to_string()) assert isinstance(new_key_info.key_name[0], ds.KeyName) assert isinstance(new_key_info.key_value[0], ds.KeyValue) assert isinstance(new_key_info.retrieval_method[0], ds.RetrievalMethod) assert isinstance(new_key_info.x509_data[0], ds.X509Data) assert isinstance(new_key_info.pgp_data[0], ds.PGPData) assert isinstance(new_key_info.spki_data[0], ds.SPKIData) assert isinstance(new_key_info.mgmt_data[0], ds.MgmtData) assert new_key_info.id == "id"
def testAccessors(self): """Test for KeyInfo accessors""" self.key_info.key_name.append(ds.key_name_from_string(ds_data.TEST_KEY_NAME)) self.key_info.key_value.append(ds.key_value_from_string(ds_data.TEST_KEY_VALUE1)) self.key_info.retrieval_method.append(ds.retrieval_method_from_string(ds_data.TEST_RETRIEVAL_METHOD)) self.key_info.x509_data.append(ds.x509_data_from_string(ds_data.TEST_X509_DATA)) self.key_info.pgp_data.append(ds.pgp_data_from_string(ds_data.TEST_PGP_DATA)) self.key_info.spki_data.append(ds.spki_data_from_string(ds_data.TEST_SPKI_DATA)) self.key_info.mgmt_data.append(ds.mgmt_data_from_string(ds_data.TEST_MGMT_DATA)) self.key_info.id = "id" new_key_info = ds.key_info_from_string(self.key_info.to_string()) assert isinstance(new_key_info.key_name[0], ds.KeyName) assert isinstance(new_key_info.key_value[0], ds.KeyValue) assert isinstance(new_key_info.retrieval_method[0], ds.RetrievalMethod) assert isinstance(new_key_info.x509_data[0], ds.X509Data) assert isinstance(new_key_info.pgp_data[0], ds.PGPData) assert isinstance(new_key_info.spki_data[0], ds.SPKIData) assert isinstance(new_key_info.mgmt_data[0], ds.MgmtData) assert new_key_info.id == "id"
def testUsingTestData(self): """Test for mgmt_data_from_string() using test data""" new_mgmt_data = ds.mgmt_data_from_string(ds_data.TEST_MGMT_DATA) assert new_mgmt_data.text.strip() == "mgmt data"
def testAccessors(self): """Test for MgmtData accessors""" self.mgmt_data.text = "mgmt data" new_mgmt_data = ds.mgmt_data_from_string(self.mgmt_data.to_string()) assert new_mgmt_data.text.strip() == "mgmt data"