Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#56)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/psf/black: 23.12.1 → 24.1.1](psf/black@23.12.1...24.1.1)

* [pre-commit.ci] auto fixes from hooks

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Feb 6, 2024
1 parent f6b07de commit 24a7d99
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ repos:
- id: pyupgrade
args: ["--py38-plus"]
- repo: https://github.com/psf/black
rev: 23.12.1
rev: 24.1.1
hooks:
- id: black
- repo: https://github.com/asottile/blacken-docs
Expand Down
1 change: 1 addition & 0 deletions src/graph_onedrive/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Entrypoint module redirects to command line interface, in case of use of `python -m graphonedrive`.
"""

from graph_onedrive._cli import main

if __name__ == "__main__":
Expand Down
1 change: 1 addition & 0 deletions src/graph_onedrive/_cli.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Command line interface tools for the Python package Graph-OneDrive.
Run terminal command 'graph-onedrive --help' or 'python -m graph-onedrive --help' for details.
"""

from __future__ import annotations

import argparse
Expand Down
1 change: 1 addition & 0 deletions src/graph_onedrive/_config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Configuration file related functions.
"""

from __future__ import annotations

import json
Expand Down
1 change: 1 addition & 0 deletions src/graph_onedrive/_decorators.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Decorators to wrap Graph-OneDrive package methods and functions.
"""

import logging
from datetime import datetime
from functools import wraps
Expand Down
1 change: 1 addition & 0 deletions src/graph_onedrive/_main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OneDrive Class and Context Manager.
"""

from graph_onedrive._manager import OneDriveManager
from graph_onedrive._onedrive import OneDrive
1 change: 1 addition & 0 deletions src/graph_onedrive/_manager.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""OneDrive context manager.
"""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions src/graph_onedrive/_onedrive.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Contains the OneDrive object class to interact through the Graph API using the Python package Graph-OneDrive.
"""

from __future__ import annotations

import asyncio
Expand Down
7 changes: 3 additions & 4 deletions tests/_config_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests the config functions using pytest."""

import json
import sys
from pathlib import Path
Expand Down Expand Up @@ -87,8 +88,7 @@ def test_load_config_raw(self, tmp_path):
data = load_config(config_path)
assert data == config

def test_load_config_failure(self):
...
def test_load_config_failure(self): ...


class TestDump:
Expand Down Expand Up @@ -140,8 +140,7 @@ def test_dump_config(self, tmp_path, config_path):
initial_file[config_key]["refresh_token"] = "new"
assert read_data == initial_file

def test_dump_config_failure(self):
...
def test_dump_config_failure(self): ...


class TestFileTypeCheck:
Expand Down
1 change: 1 addition & 0 deletions tests/_decorators_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests the OneDrive decorators pytest."""

from datetime import datetime
from datetime import timedelta

Expand Down
1 change: 1 addition & 0 deletions tests/_manager_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests the OneDrive context manager using pytest."""

import json
from pathlib import Path

Expand Down
33 changes: 12 additions & 21 deletions tests/_onedrive_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests the OneDrive class using pytest."""

import json
import logging
import os
Expand Down Expand Up @@ -601,8 +602,7 @@ def test_list_directory_folder(self, onedrive):
assert items[0].get("id") == "01BYE5RZZWSN2ASHUEBJH2XJJ25WSEBUJ3"

@pytest.mark.skip(reason="not implemented")
def test_list_directory_failure(self, onedrive):
...
def test_list_directory_failure(self, onedrive): ...

def test_list_directory_failure_type(self, onedrive):
with pytest.raises(TypeError) as excinfo:
Expand All @@ -627,8 +627,7 @@ def test_search(self, onedrive, query, top, exp_len):
assert len(items) == exp_len

@pytest.mark.skip(reason="not implemented")
def test_search_failure(self, onedrive):
...
def test_search_failure(self, onedrive): ...

@pytest.mark.parametrize(
"query, top, exp_msg",
Expand Down Expand Up @@ -713,8 +712,7 @@ def test_detail_item_verbose(self, onedrive, capsys, item_id, exp_stout):
assert stdout == exp_stout

@pytest.mark.skip(reason="not implemented")
def test_detail_item_failure(self):
...
def test_detail_item_failure(self): ...

# detail_item_path
def test_detail_item_path(self, onedrive):
Expand All @@ -735,8 +733,7 @@ def test_item_type(self, onedrive, item_id, exp_type):
assert item_type == exp_type

@pytest.mark.skip(reason="not implemented")
def test_item_type_failure(self):
...
def test_item_type_failure(self): ...

# is_folder
@pytest.mark.parametrize(
Expand All @@ -751,8 +748,7 @@ def test_is_folder(self, onedrive, item_id, exp_bool):
assert is_folder == exp_bool

@pytest.mark.skip(reason="not implemented")
def test_is_folder_failure(self):
...
def test_is_folder_failure(self): ...

# is_file
@pytest.mark.parametrize(
Expand All @@ -767,8 +763,7 @@ def test_is_file(self, onedrive, item_id, exp_bool):
assert is_file == exp_bool

@pytest.mark.skip(reason="not implemented")
def test_is_file_failure(self):
...
def test_is_file_failure(self): ...


class TestSharingLink:
Expand Down Expand Up @@ -932,7 +927,7 @@ class TestMakeFolder:
("tesy 1", "01BYE5RZ4CPC5XBOTZCFD2CT7SZFNICEYC", True, "ACEA49D1-144"),
("tesy 1", "01BYE5RZ4CPC5XBOTZCFD2CT7SZFNICEYC", False, "ACEA49D1-144"),
("tesy 1", None, True, "ACEA49D1-144"),
("tesy 1", None, False, "ACEA49D1-144")
("tesy 1", None, False, "ACEA49D1-144"),
# To-do: allow for other folder names by using a side effect in the mock route
],
)
Expand All @@ -943,8 +938,7 @@ def test_make_folder(
assert item_id == exp_str

@pytest.mark.skip(reason="not implemented")
def test_make_folder_failure(self):
...
def test_make_folder_failure(self): ...


class TestMove:
Expand Down Expand Up @@ -1098,8 +1092,7 @@ def test_rename_item(self, onedrive):
assert returned_name == new_name

@pytest.mark.skip(reason="not implemented")
def test_rename_item_failure(self):
...
def test_rename_item_failure(self): ...


class TestDelete:
Expand Down Expand Up @@ -1149,12 +1142,10 @@ class TestDownload:

# download_file
@pytest.mark.skip(reason="not implemented")
def test_download_file(self):
...
def test_download_file(self): ...

@pytest.mark.skip(reason="not implemented")
def test_download_file_failure(self):
...
def test_download_file_failure(self): ...

"""# _download_async
@pytest.mark.skip(reason="not implemented")
Expand Down
7 changes: 4 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Sets-up and tears-down configuration used for testing."""

import json
import os
import re
Expand Down Expand Up @@ -244,9 +245,9 @@ def side_effect_search(request):
if next:
alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" # = string.ascii_letters + string.digits
skip_token = "s!" + "".join(secrets.choice(alphabet) for _ in range(10))
response_json[
"@odata.nextLink"
] = f"https://graph.microsoft.com/v1.0/me/drive/root/search(q='{query}')?$top={top}&$skiptoken={skip_token}"
response_json["@odata.nextLink"] = (
f"https://graph.microsoft.com/v1.0/me/drive/root/search(q='{query}')?$top={top}&$skiptoken={skip_token}"
)
return httpx.Response(200, json=response_json)


Expand Down

0 comments on commit 24a7d99

Please sign in to comment.