def test__from_template__log_and_subnet_fields__fields_set(self):
        "AsiaqDataPipeline.from_template with a log location and subnet ID"
        pipeline = AsiaqDataPipeline.from_template(
            name="asdf",
            description="qwerty",
            template_name="dynamodb_backup",
            log_location="FAKEY",
            subnet_id="McFAKEFAKE")
        self.assertFalse(pipeline._tags)
        self.assertFalse(pipeline.is_persisted())
        self.assertTrue(pipeline.has_content())

        def _find_default(objects):
            for obj in objects:
                if obj['id'] == 'Default':
                    return obj

        default_object = _find_default(pipeline._objects)
        self.assertIn({
            'key': 'pipelineLogUri',
            'stringValue': 'FAKEY'
        }, default_object['fields'])
        self.assertIn({
            'key': 'subnetId',
            'stringValue': 'McFAKEFAKE'
        }, default_object['fields'])
Exemplo n.º 2
0
 def test__from_template__backup_period_value(self):
     "AsiaqDataPipeline.from_template test if from_template contains myDDBSchedulePeriod."
     expected_period_value = "#{myDDBSchedulePeriod}"
     pipeline = AsiaqDataPipeline.from_template(
         name="asdf", description="qwerty", template_name="dynamodb_backup")
     actual_pipeline_schedule = pipeline._objects[0]
     actual_schedule_fields = actual_pipeline_schedule['fields']
     self.assertEqual(expected_period_value, actual_schedule_fields[0]['stringValue'])
 def test__from_template__backup_period_value(self):
     "AsiaqDataPipeline.from_template test if from_template contains myDDBSchedulePeriod."
     expected_period_value = "#{myDDBSchedulePeriod}"
     pipeline = AsiaqDataPipeline.from_template(
         name="asdf", description="qwerty", template_name="dynamodb_backup")
     actual_pipeline_schedule = pipeline._objects[0]
     actual_schedule_fields = actual_pipeline_schedule['fields']
     self.assertEqual(expected_period_value,
                      actual_schedule_fields[0]['stringValue'])
Exemplo n.º 4
0
 def test__from_template__template_ok__reasonable(self):
     "AsiaqDataPipeline.from_template with a valid template"
     pipeline = AsiaqDataPipeline.from_template(
         name="asdf", description="qwerty", template_name="dynamodb_backup")
     self.assertFalse(pipeline._tags)
     self.assertFalse(pipeline.is_persisted())
     self.assertTrue(pipeline.has_content())
     # nasty cherry-pick:
     self.assertEqual("SchedulePeriod", pipeline._objects[0]['id'])
     self.assertEqual(pipeline._name, "asdf")
     self.assertEqual(pipeline._description, "qwerty")
 def test__from_template__template_ok__reasonable(self):
     "AsiaqDataPipeline.from_template with a valid template"
     pipeline = AsiaqDataPipeline.from_template(
         name="asdf", description="qwerty", template_name="dynamodb_backup")
     self.assertFalse(pipeline._tags)
     self.assertFalse(pipeline.is_persisted())
     self.assertTrue(pipeline.has_content())
     # nasty cherry-pick:
     self.assertEqual("SchedulePeriod", pipeline._objects[0]['id'])
     self.assertEqual(pipeline._name, "asdf")
     self.assertEqual(pipeline._description, "qwerty")
Exemplo n.º 6
0
    def test__from_template__log_and_subnet_fields__fields_set(self):
        "AsiaqDataPipeline.from_template with a log location and subnet ID"
        pipeline = AsiaqDataPipeline.from_template(
            name="asdf", description="qwerty", template_name="dynamodb_backup",
            log_location="FAKEY", subnet_id="McFAKEFAKE")
        self.assertFalse(pipeline._tags)
        self.assertFalse(pipeline.is_persisted())
        self.assertTrue(pipeline.has_content())

        def _find_default(objects):
            for obj in objects:
                if obj['id'] == 'Default':
                    return obj

        default_object = _find_default(pipeline._objects)
        self.assertIn({'key': 'pipelineLogUri', 'stringValue': 'FAKEY'}, default_object['fields'])
        self.assertIn({'key': 'subnetId', 'stringValue': 'McFAKEFAKE'}, default_object['fields'])