Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Websites UFRPE
Django Private Storage
Commits
7d62a3b7
Commit
7d62a3b7
authored
May 09, 2017
by
Diederik van der Boor
Browse files
Add testing framework, no tests written yet
parent
ea33f2f8
Changes
6
Hide whitespace changes
Inline
Side-by-side
.coveragerc
0 → 100644
View file @
7d62a3b7
[run]
source = private_storage
.travis.yml
0 → 100644
View file @
7d62a3b7
sudo
:
false
language
:
python
python
:
-
'
2.7'
-
'
3.6'
env
:
-
DJANGO="django>=1.8.0,<1.9.0"
-
DJANGO="django>=1.9.0,<1.10.0"
-
DJANGO="django>=1.10.0,<1.11.0"
-
DJANGO="django>=1.11.0,<1.12.0"
before_install
:
-
pip install codecov
install
:
-
travis_retry pip install $DJANGO django-storages boto3 -e .
script
:
-
coverage run --rcfile=.coveragerc runtests.py
after_success
:
-
codecov
branches
:
only
:
-
master
notifications
:
email
:
recipients
:
-
travis@edoburu.nl
on_success
:
never
on_failure
:
always
slack
:
secure
:
WWNa4MHf50AOybB+XW9UKXCk/9Q8r++Jc4xTdEib43rj4odH9wxIaTRrzAbbpo3EO2gYuLgq6mMbaIZPD5l2UmgSnyuIbeYAAKIQblT+8XMamtXwnSS5j9vfBXYdj54rTlh+jKwEMW/JiQKl+SQpfQ2v1NMvYO63m89Ev9vXvcU=
on_success
:
never
on_failure
:
always
private_storage/tests/__init__.py
0 → 100644
View file @
7d62a3b7
private_storage/tests/test_imports.py
0 → 100644
View file @
7d62a3b7
# Most pathetic test case ever, only see if all files are importable.
# TODO: write real tests.
import
private_storage
import
private_storage.storage.files
import
private_storage.storage.s3boto3
import
private_storage.appconfig
import
private_storage.fields
import
private_storage.models
import
private_storage.permissions
import
private_storage.servers
import
private_storage.urls
import
private_storage.views
runtests.py
0 → 100755
View file @
7d62a3b7
#!/usr/bin/env python
import
sys
import
django
from
django.conf
import
settings
,
global_settings
as
default_settings
from
django.core.management
import
execute_from_command_line
from
os
import
path
if
not
settings
.
configured
:
module_root
=
path
.
dirname
(
path
.
realpath
(
__file__
))
sys
.
path
.
insert
(
0
,
path
.
join
(
module_root
,
'example'
))
if
django
.
VERSION
>=
(
1
,
8
):
template_settings
=
dict
(
TEMPLATES
=
[
{
'BACKEND'
:
'django.template.backends.django.DjangoTemplates'
,
'DIRS'
:
(),
'DEBUG'
:
True
,
'OPTIONS'
:
{
'loaders'
:
(
'django.template.loaders.filesystem.Loader'
,
'django.template.loaders.app_directories.Loader'
,
),
'context_processors'
:
(
'django.template.context_processors.debug'
,
'django.template.context_processors.i18n'
,
'django.template.context_processors.media'
,
'django.template.context_processors.request'
,
'django.template.context_processors.static'
,
'django.contrib.auth.context_processors.auth'
,
),
},
},
]
)
else
:
template_settings
=
dict
(
TEMPLATE_LOADERS
=
(
'django.template.loaders.app_directories.Loader'
,
'django.template.loaders.filesystem.Loader'
,
),
TEMPLATE_CONTEXT_PROCESSORS
=
list
(
default_settings
.
TEMPLATE_CONTEXT_PROCESSORS
)
+
[
'django.core.context_processors.request'
,
],
TEMPLATE_DEBUG
=
True
,
)
settings
.
configure
(
DEBUG
=
False
,
# will be False anyway by DjangoTestRunner.
DATABASES
=
{
'default'
:
{
'ENGINE'
:
'django.db.backends.sqlite3'
,
'NAME'
:
':memory:'
}
},
INSTALLED_APPS
=
(
'private_storage'
,
),
TEST_RUNNER
=
'django.test.runner.DiscoverRunner'
,
AWS_PRIVATE_STORAGE_BUCKET_NAME
=
'foobar'
,
**
template_settings
)
def
runtests
():
argv
=
sys
.
argv
[:
1
]
+
[
'test'
,
'private_storage'
]
+
sys
.
argv
[
1
:]
execute_from_command_line
(
argv
)
if
__name__
==
'__main__'
:
runtests
()
tox.ini
0 → 100644
View file @
7d62a3b7
[tox]
envlist
=
py27-django{18,19,110,111},
py36-django{18,19,110,111},
# py36-django-dev,
coverage,
[testenv]
deps
=
django-storages
boto3
django18:
Django
>=
1.8,<1.9
django19:
Django
>=
1.9,<1.10
django110:
Django
>=
1.10,<1.11
django111:
Django
>=
1.11,<1.12
django-dev:
https://github.com/django/django/tarball/master
commands
=
python
runtests.py
[testenv:coverage]
basepython
=
python3.6
deps
=
django
=
=1.11
coverage
commands
=
coverage
erase
coverage
run
--rcfile
=
.coveragerc runtests.py
coverage
report
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment