Path: blob/develop/tests/unit/customizations/s3/syncstrategy/test_delete.py
1569 views
# Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.1#2# Licensed under the Apache License, Version 2.0 (the "License"). You3# may not use this file except in compliance with the License. A copy of4# the License is located at5#6# http://aws.amazon.com/apache2.0/7#8# or in the "license" file accompanying this file. This file is9# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF10# ANY KIND, either express or implied. See the License for the specific11# language governing permissions and limitations under the License.12import datetime1314from awscli.customizations.s3.filegenerator import FileStat15from awscli.customizations.s3.syncstrategy.delete import DeleteSync1617from awscli.testutils import unittest181920class TestDeleteSync(unittest.TestCase):21def setUp(self):22self.sync_strategy = DeleteSync()2324def test_determine_should_sync(self):25timenow = datetime.datetime.now()2627dst_file = FileStat(src='', dest='',28compare_key='test.py', size=10,29last_update=timenow, src_type='local',30dest_type='s3', operation_name='')3132should_sync = self.sync_strategy.determine_should_sync(33None, dst_file)34self.assertTrue(should_sync)35self.assertEqual(dst_file.operation_name, 'delete')363738if __name__ == "__main__":39unittest.main()404142