コード例 #1
0
ファイル: tests.py プロジェクト: jeredding/stacktach
    def test_process_delete(self):
        launched_str = '2012-12-21 06:34:50.123'
        launched = utils.str_time_to_unix(launched_str)
        deleted_str = '2012-12-21 12:34:50.123'
        deleted = utils.str_time_to_unix(deleted_str)
        json = test_utils.make_delete_end_json(launched_str, deleted_str)
        raw = create_raw(self.deployment, deleted,
                         views.INSTANCE_EVENT['delete_end'], json=json)

        views._process_delete(raw)

        delete = InstanceDeletes.objects.all()
        self.assertEqual(len(delete), 1)
        delete = delete[0]
        self.assertEqual(delete.instance, INSTANCE_ID_1)
        self.assertEqual(delete.launched_at, launched)
        self.assertEqual(delete.deleted_at, deleted)
        self.assertEqual(delete.raw.id, raw.id)
コード例 #2
0
ファイル: tests.py プロジェクト: manalilatkar/stacktach
    def test_process_delete(self):
        launched_str = '2012-12-21 06:34:50.123'
        launched = utils.str_time_to_unix(launched_str)
        deleted_str = '2012-12-21 12:34:50.123'
        deleted = utils.str_time_to_unix(deleted_str)
        json = test_utils.make_delete_end_json(launched_str, deleted_str)
        raw = create_raw(self.deployment,
                         deleted,
                         views.INSTANCE_EVENT['delete_end'],
                         json=json)

        views._process_delete(raw)

        delete = InstanceDeletes.objects.all()
        self.assertEqual(len(delete), 1)
        delete = delete[0]
        self.assertEqual(delete.instance, INSTANCE_ID_1)
        self.assertEqual(delete.launched_at, launched)
        self.assertEqual(delete.deleted_at, deleted)
        self.assertEqual(delete.raw.id, raw.id)