This repository has been archived by the owner on Jan 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix 151: correctly guess strategy for storage subclasses
- Loading branch information
1 parent
c6da306
commit 7208faf
Showing
6 changed files
with
85 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "1.1.0" | ||
__version__ = "1.1.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from storages.backends.s3boto3 import S3Boto3Storage | ||
|
||
|
||
class CustomStorage(S3Boto3Storage): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from storages.backends.s3boto import S3BotoStorage | ||
|
||
|
||
class CustomStorage(S3BotoStorage): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from unittest import TestCase | ||
|
||
from collectfast.strategies.base import _BOTO3_STORAGE | ||
from collectfast.strategies.base import _BOTO3_STRATEGY | ||
from collectfast.strategies.base import _BOTO_STORAGE | ||
from collectfast.strategies.base import _BOTO_STRATEGY | ||
from collectfast.strategies.base import guess_strategy | ||
from collectfast.tests.utils import test | ||
|
||
|
||
@test | ||
def test_guesses_boto_from_exact(case): | ||
# type: (TestCase) -> None | ||
case.assertEqual(guess_strategy(_BOTO_STORAGE), _BOTO_STRATEGY) | ||
|
||
|
||
@test | ||
def test_guesses_boto3_from_exact(case): | ||
# type: (TestCase) -> None | ||
case.assertEqual(guess_strategy(_BOTO3_STORAGE), _BOTO3_STRATEGY) | ||
|
||
|
||
@test | ||
def test_guesses_boto_from_subclass(case): | ||
# type: (TestCase) -> None | ||
case.assertEqual( | ||
guess_strategy("collectfast.tests.boto_subclass.CustomStorage"), _BOTO_STRATEGY | ||
) | ||
|
||
|
||
@test | ||
def test_guesses_boto3_from_subclass(case): | ||
# type: (TestCase) -> None | ||
case.assertEqual( | ||
guess_strategy("collectfast.tests.boto3_subclass.CustomStorage"), | ||
_BOTO3_STRATEGY, | ||
) |