Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xblock-utils
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
xblock-utils
Commits
c868900f
Commit
c868900f
authored
Sep 20, 2017
by
Brian Mesick
Committed by
GitHub
Sep 20, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tox support, clean up quality violations (#45)
parent
9ccb1b4f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
52 additions
and
15 deletions
+52
-15
.gitignore
+3
-0
.travis.yml
+10
-9
test_requirements.txt
+2
-2
tox.ini
+35
-0
xblockutils/settings.py
+1
-2
xblockutils/studio_editable.py
+1
-2
No files found.
.gitignore
View file @
c868900f
...
...
@@ -4,3 +4,6 @@
cover
xblock_utils.egg-info
tests.integration.*.png
.idea/
.tox/
var/
.travis.yml
View file @
c868900f
...
...
@@ -2,25 +2,26 @@ language: python
addons
:
firefox
:
"
52.0esr"
python
:
-
"
2.7"
-
2.7
before_install
:
-
"
export
DISPLAY=:99"
-
"
sh
-e
/etc/init.d/xvfb
start"
install
:
-
"
pip
install
-e
git://github.com/edx/xblock-sdk.git@22c1b2f173919bef22f2d9d9295ec5396d02dffd#egg=xblock-sdk"
-
"
pip
install
-r
$VIRTUAL_ENV/src/xblock-sdk/requirements/base.txt"
-
"
pip
install
-r
$VIRTUAL_ENV/src/xblock-sdk/requirements/test.txt"
-
"
pip
install
-r
requirements.txt"
-
"
pip
install
-r
test_requirements.txt"
-
"
mkdir
var"
-
"
wget
https://github.com/mozilla/geckodriver/releases/download/v0.15.0/geckodriver-v0.15.0-linux64.tar.gz"
-
"
mkdir
geckodriver"
-
"
tar
-xzf
geckodriver-v0.15.0-linux64.tar.gz
-C
geckodriver"
-
"
export
PATH=$PATH:$PWD/geckodriver"
-
"
pip
install
tox"
env
:
-
TOX_ENV=django18
-
TOX_ENV=django111
matrix
:
include
:
-
python
:
2.7
env
:
TOX_ENV=quality
script
:
-
pep8 xblockutils --max-line-length=120
-
pylint xblockutils
-
python run_tests.py --with-coverage --cover-package=xblockutils
-
tox -e $TOX_ENV
notifications
:
email
:
false
branches
:
...
...
test_requirements.txt
View file @
c868900f
ddt
mock
\ No newline at end of file
mock
fs
<2
tox.ini
0 → 100644
View file @
c868900f
[tox]
envlist
=
py{27}-django{18,111}
# The ordering of deps and commands here is weird due to the way we install xblock-sdk and associated dependencies.
# Installing test/base.txt inside deps fails, and installing the env-specific Django versions inside deps
# causes Django 1.4 to be installed over it by something later in the process.
[base]
deps
=
-rrequirements.txt
-rtest_requirements.txt
-egit+https://github.com/edx/xblock-sdk.git
#egg=xblock-sdk
commands
=
pip
install
-r
{envdir}/src/xblock-sdk/requirements/test.txt
pip
install
-r
{envdir}/src/xblock-sdk/requirements/base.txt
[testenv]
passenv
=
CI TRAVIS TRAVIS_* DISPLAY
deps
=
{
[base]
deps}
commands
=
{
[base]
commands}
django18:
pip
install
Django>=1.8,<1.9
django110:
pip
install
Django>=1.10,<1.11
django111:
pip
install
Django>=1.11,<2.0
python
./run_tests.py
--with-coverage
--cover-package
=
xblockutils
[testenv:quality]
basepython
=
python2.7
deps
=
{
[base]
deps}
commands
=
{
[base]
commands}
pip
install
Django>=1.11,<2.0
pep8
xblockutils
--max-line-length
=
120
pylint
xblockutils
xblockutils/settings.py
View file @
c868900f
...
...
@@ -35,8 +35,7 @@ class XBlockWithSettingsMixin(object):
settings_service
=
self
.
runtime
.
service
(
self
,
"settings"
)
if
settings_service
:
return
settings_service
.
get_settings_bucket
(
self
,
default
=
default
)
else
:
return
default
return
default
class
ThemableXBlockMixin
(
object
):
...
...
xblockutils/studio_editable.py
View file @
c868900f
...
...
@@ -317,8 +317,7 @@ class StudioContainerXBlockMixin(object):
if
root_xblock
and
root_xblock
.
location
==
self
.
location
:
# User has clicked the "View" link. Show an editable preview of this block's children
return
self
.
author_edit_view
(
context
)
else
:
return
self
.
author_preview_view
(
context
)
return
self
.
author_preview_view
(
context
)
def
author_edit_view
(
self
,
context
):
"""
...
...
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