Skip to content

Conversation

@artem-shelkovnikov
Copy link
Member

Subj.

Comment on lines +3120 to +3121
assert isinstance(client.graph_api_token, EntraAPIToken)
assert isinstance(client.rest_api_token, EntraAPIToken)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to add other checks too like that it has the expected _certificate / _scope / _private_key?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'd test it properly, I'd actually test behaviour - pass certs and private key and verify that requests contain them, but the code is already quite a mess, I wanted to have something somewhat working to be able to unblock merges - now we're at 91.99/92% coverage and CI started to inconsistently fail


download_result = source.download_function(drive_item, max_drive_item_age)

assert download_result is not None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess there's already an existing pattern, but would we be able to make a more precise assertion?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd again make the assertion behavioral - rather than just checking the download function, check that using it is producing an expected API call to 3rd-party, but I don't think we've done things like that yet. Our testing codebase is pretty messy tbh 😬

@artem-shelkovnikov artem-shelkovnikov merged commit 530e7c0 into main Oct 20, 2025
2 checks passed
@artem-shelkovnikov artem-shelkovnikov deleted the artem/add-coverage-sharepoint-online-py branch October 20, 2025 10:04
github-actions bot pushed a commit that referenced this pull request Oct 20, 2025
@github-actions
Copy link

💔 Failed to create backport PR(s)

Status Branch Result
9.0 Commit could not be cherrypicked due to conflicts
8.18 Commit could not be cherrypicked due to conflicts
9.1 #3796
8.19 Commit could not be cherrypicked due to conflicts
9.2 Commit could not be cherrypicked due to conflicts

Successful backport PRs will be merged automatically after passing CI.

To backport manually run:
backport --pr 3795 --autoMerge --autoMergeMethod squash

artem-shelkovnikov added a commit that referenced this pull request Oct 20, 2025
… stuff again (#3795)

Subj.

(cherry picked from commit 530e7c0)

# Conflicts:
#	NOTICE.txt
artem-shelkovnikov added a commit that referenced this pull request Oct 20, 2025
… stuff again (#3795)

Subj.

(cherry picked from commit 530e7c0)

# Conflicts:
#	NOTICE.txt
artem-shelkovnikov added a commit that referenced this pull request Oct 20, 2025
… stuff again (#3795)

Subj.

(cherry picked from commit 530e7c0)

# Conflicts:
#	NOTICE.txt
artem-shelkovnikov added a commit that referenced this pull request Oct 20, 2025
… stuff again (#3795)

Subj.

(cherry picked from commit 530e7c0)

# Conflicts:
#	NOTICE.txt
@artem-shelkovnikov
Copy link
Member Author

💚 All backports created successfully

Status Branch Result
9.2
9.0
8.19
8.18

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

artem-shelkovnikov added a commit that referenced this pull request Oct 20, 2025
…t/merge stuff again (#3795) (#3799)

# Backport

This will backport the following commits from `main` to `8.19`:
- [Add some code coverage for SPO connector to be able to backport/merge
stuff again (#3795)](#3795)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)
artem-shelkovnikov added a commit that referenced this pull request Oct 20, 2025
…/merge stuff again (#3795) (#3797)

# Backport

This will backport the following commits from `main` to `9.2`:
- [Add some code coverage for SPO connector to be able to backport/merge
stuff again (#3795)](#3795)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)
artem-shelkovnikov added a commit that referenced this pull request Oct 20, 2025
…/merge stuff again (#3795) (#3798)

# Backport

This will backport the following commits from `main` to `9.0`:
- [Add some code coverage for SPO connector to be able to backport/merge
stuff again (#3795)](#3795)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)
artem-shelkovnikov added a commit that referenced this pull request Oct 20, 2025
…t/merge stuff again (#3795) (#3800)

# Backport

This will backport the following commits from `main` to `8.18`:
- [Add some code coverage for SPO connector to be able to backport/merge
stuff again (#3795)](#3795)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)
artem-shelkovnikov added a commit that referenced this pull request Oct 20, 2025
…/merge stuff again (#3795) (#3796)

Backports the following commits to 9.1:
- Add some code coverage for SPO connector to be able to backport/merge
stuff again (#3795)

Co-authored-by: Artem Shelkovnikov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants