Exemplo n.º 1
0
 def test_lifecycle_translation(self):
     """Tests lifecycle translation for various formats."""
     json_text = self.lifecycle_doc
     entries_list = LifecycleTranslation.JsonLifecycleToMessage(json_text)
     boto_lifecycle = LifecycleTranslation.BotoLifecycleFromMessage(
         entries_list)
     converted_entries_list = LifecycleTranslation.BotoLifecycleToMessage(
         boto_lifecycle)
     converted_json_text = LifecycleTranslation.JsonLifecycleFromMessage(
         converted_entries_list)
     self.assertEqual(json.loads(json_text),
                      json.loads(converted_json_text))
Exemplo n.º 2
0
  def test_lifecycle_translation(self):
    """Tests lifecycle translation for various formats."""
    # TODO: Use lifecycle_doc again once Boto is updated to support new fields.
    # json_text = self.lifecycle_doc
    json_text = self.lifecycle_doc_without_storage_class_fields

    entries_list = LifecycleTranslation.JsonLifecycleToMessage(json_text)
    boto_lifecycle = LifecycleTranslation.BotoLifecycleFromMessage(entries_list)
    converted_entries_list = LifecycleTranslation.BotoLifecycleToMessage(
        boto_lifecycle)
    converted_json_text = LifecycleTranslation.JsonLifecycleFromMessage(
        converted_entries_list)
    self.assertEqual(json.loads(json_text), json.loads(converted_json_text))