Пример #1
0
  def testExpireAndExpandDryrun(self):
    self.patchSafeList()

    purge_lib.ExpandAndExpire(self.ctx, True, self.expireDate,
                              self.file_no_timestamp)
    purge_lib.ExpandAndExpire(self.ctx, True, self.expireDate,
                              self.file_with_timestamp)
    purge_lib.ExpandAndExpire(self.ctx, True, self.expireDate,
                              self.directory)

    self.assertEqual(self.gs_mock.call_args_list, [])
Пример #2
0
  def testExpireAndExpandWithTimestamp(self):
    self.patchSafeList()

    # File with timestamp.
    purge_lib.ExpandAndExpire(self.ctx, False, self.expireDate,
                              self.file_with_timestamp)

    self.assertEqual(self.gs_mock.call_args_list, [
        mock.call(self.ctx, [
            'mv', '--',
            'gs://chromeos-releases/canary-channel/plain_file',
            'gs://chromeos-releases-backup/canary-channel/plain_file',
        ]),
    ])
Пример #3
0
  def testExpireAndExpandDirectory(self):
    self.patchSafeList()

    purge_lib.ExpandAndExpire(self.ctx, False, self.expireDate,
                              self.directory)

    self.assertEqual(self.gs_mock.call_args_list, [
        mock.call(self.ctx, [
            'mv', '--',
            'gs://chromeos-releases/canary-channel/x86-alex/1.2.3/a',
            'gs://chromeos-releases-backup/canary-channel/x86-alex/1.2.3/a',
        ]),
        mock.call(self.ctx, [
            'mv', '--',
            'gs://chromeos-releases/canary-channel/x86-alex/1.2.3/nest/deep',
            'gs://chromeos-releases-backup/canary-channel/x86-alex/1.2.3/'
            'nest/deep',
        ]),
    ])