Пример #1
0
  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"
Пример #2
0
    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"
Пример #3
0
 def testUsingTestData(self):
     """Test for key_name_from_string() using test data"""
     new_key_name = ds.key_name_from_string(ds_data.TEST_KEY_NAME)
     assert new_key_name.text.strip() == "key name"
Пример #4
0
 def testAccessors(self):
     """Test for KeyName accessors"""
     self.key_name.text = "key name"
     new_key_name = ds.key_name_from_string(self.key_name.to_string())
     assert new_key_name.text.strip() == "key name"
Пример #5
0
 def testUsingTestData(self):
   """Test for key_name_from_string() using test data"""
   new_key_name = ds.key_name_from_string(ds_data.TEST_KEY_NAME)
   assert new_key_name.text.strip() == "key name"
Пример #6
0
 def testAccessors(self):
   """Test for KeyName accessors"""
   self.key_name.text = "key name"
   new_key_name = ds.key_name_from_string(self.key_name.to_string())
   assert new_key_name.text.strip() == "key name"