コード例 #1
0
ファイル: test_upload.py プロジェクト: 1-vn/onevn-core
    def test_calls_upload(self):
        upload.upload_onevn(self.repo, self.release, self.file_path)
        upload.upload_io_to_github.assert_called()

        args, kwargs = upload.upload_io_to_github.call_args
        self.assertTrue(args[0] == self.repo)
        self.assertTrue(args[2] == self.release.assets._assets[0].name)
        self.assertTrue(args[4] == 'application/zip')
コード例 #2
0
ファイル: test_upload.py プロジェクト: 1-vn/onevn-core
    def test_calls_upload_with_filename_override(self):
        fake_filename = 'fake-name-here'
        upload.upload_onevn(self.repo, self.release,
                            self.file_path, fake_filename)
        upload.upload_io_to_github.assert_called()

        args, kwargs = upload.upload_io_to_github.call_args
        self.assertTrue(args[0] == self.repo)
        self.assertTrue(args[2] == fake_filename)
        self.assertTrue(args[4] == 'application/zip')
コード例 #3
0
ファイル: test_upload.py プロジェクト: 1-vn/onevn-core
 def test_calls_uploads_checksum(self):
     upload.upload_onevn(self.repo, self.release, self.file_path)
     upload.upload_sha256_checksum.assert_called_with(
         self.release.tag_name, self.file_path)
コード例 #4
0
ファイル: test_upload.py プロジェクト: 1-vn/onevn-core
 def test_force_delete_before_upload_when_force_true_with_filename_override(self):
     fake_filename = 'fake-name-here'
     upload.upload_onevn(self.repo, self.release,
                         self.file_path, fake_filename, True)
     upload.delete_file.assert_called_with(
         self.repo, self.release, fake_filename)
コード例 #5
0
ファイル: test_upload.py プロジェクト: 1-vn/onevn-core
 def test_force_delete_before_upload_when_force_true(self):
     upload.upload_onevn(self.repo, self.release,
                         self.file_path, None, True)
     upload.delete_file.assert_called_with(
         self.repo, self.release, self.release.assets._assets[0].name)
コード例 #6
0
ファイル: test_upload.py プロジェクト: 1-vn/onevn-core
 def test_does_not_force_delete_before_upload_when_force_false(self):
     upload.upload_onevn(self.repo, self.release, self.file_path)
     upload.delete_file.assert_not_called()
コード例 #7
0
ファイル: test_upload.py プロジェクト: 1-vn/onevn-core
 def test_does_not_call_delete_if_asset_not_present(self):
     empty_repo = Repo()
     upload.upload_onevn(empty_repo, self.release, self.file_path)
     self.asset.delete.assert_not_called()
コード例 #8
0
ファイル: test_upload.py プロジェクト: 1-vn/onevn-core
 def test_calls_delete_if_asset_already_exists(self):
     upload.upload_onevn(self.repo, self.release, self.file_path)
     self.asset.delete.assert_called()