[fedocal] master: Add possibility to specify more argument to nose by passing them to the shell script (95d1558)
by Pierre-YvesChibon
Repository : http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
>---------------------------------------------------------------
commit 95d1558e9b293e8673606308200ab82ba6f6529f
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Mon Dec 10 20:27:36 2012 +0100
Add possibility to specify more argument to nose by passing them to the shell script
This way you can run "./run_tests.sh -x" to add the "-x" argument to nose which is
"stop at the first error/fail" argument.
Update documentation to reflect this possibility.
Add some more documentation on how to run single test suite from the command line
using python -m unittest
>---------------------------------------------------------------
doc/development.rst | 23 +++++++++++++++++++++--
run_tests.sh | 2 +-
2 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/doc/development.rst b/doc/development.rst
index 97d1e47..0176af9 100644
--- a/doc/development.rst
+++ b/doc/development.rst
@@ -116,6 +116,17 @@ unit-tests of the project with coverage information using `python-nose
<https://nose.readthedocs.org/>`_.
+.. note:: You can specify additional arguments to the nose command used
+ in this script by just passing arguments to the script.
+
+ For example you can specify the ``-x`` / ``--stop`` argument:
+ `Stop running tests after the first error or failure` by just doing
+
+ ::
+
+ ./run_tests.sh --stop
+
+
Each unit-tests files (located under ``fedocal/tests/``) can be called
by alone, allowing easier debugging of the tests. For example:
@@ -123,8 +134,16 @@ by alone, allowing easier debugging of the tests. For example:
python fedocal/tests/test_week.py
-.. note:: In order to have the coverage information you might have to
- install ``python-coverage``
+Similarly as for nose you can also ask that the unit-test stop at the first
+error or failure. For example, the command could be:
+
+::
+
+ FEDOCAL_CONFIG=tests/fedocal_test.cfg python -m unittest -f -v fedocal.tests.test_week
+
+
+.. note:: In order to have coverage information you might have to install
+ ``python-coverage``
::
diff --git a/run_tests.sh b/run_tests.sh
index 101b71c..e5b8373 100755
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -1,2 +1,2 @@
#!/bin/bash
-FEDOCAL_CONFIG=tests/fedocal_test.cfg PYTHONPATH=fedocal nosetests --with-coverage --cover-package=fedocal
+FEDOCAL_CONFIG=tests/fedocal_test.cfg PYTHONPATH=fedocal nosetests --with-coverage --cover-package=fedocal $*
11 years, 4 months
[fedocal] master: Launch test server (565d72b)
by trasher@fedorahosted.org
Repository : http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
>---------------------------------------------------------------
commit 565d72b53bc7e37ff20a519089d8a2fd4b53c72f
Author: Johan Cwiklinski <johan(a)x-tnd.be>
Date: Mon Dec 10 17:11:56 2012 +0100
Launch test server
>---------------------------------------------------------------
README.rst | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/README.rst b/README.rst
index b930358..bd76d66 100644
--- a/README.rst
+++ b/README.rst
@@ -71,7 +71,7 @@ Create the database scheme::
Run the server::
- python fedocal/__init__.py
+ sh runserver
You should be able to access the server at http://localhost:5000
11 years, 4 months
[fedocal] master: Import icons created by Mark Klein - license cc-by (8de6b3c)
by pingou@fedorahosted.org
Repository : http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
>---------------------------------------------------------------
commit 8de6b3c7744b9b19a3cbf5394dcdb763eaf041b3
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Wed Dec 5 22:23:40 2012 +0100
Import icons created by Mark Klein - license cc-by
>---------------------------------------------------------------
doc/icons/fedocal_favicon.xcf | Bin 0 -> 147153 bytes
doc/icons/fedocal_logo.xcf | Bin 0 -> 357325 bytes
2 files changed, 0 insertions(+), 0 deletions(-)
diff --git a/doc/icons/fedocal_favicon.xcf b/doc/icons/fedocal_favicon.xcf
new file mode 100644
index 0000000..d5383b4
Binary files /dev/null and b/doc/icons/fedocal_favicon.xcf differ
diff --git a/doc/icons/fedocal_logo.xcf b/doc/icons/fedocal_logo.xcf
new file mode 100644
index 0000000..cb20b7c
Binary files /dev/null and b/doc/icons/fedocal_logo.xcf differ
11 years, 4 months
[fedocal] master: Though shall close the parenthesis... (1130c5a)
by Pierre-YvesChibon
Repository : http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
>---------------------------------------------------------------
commit 1130c5a60bf8bde4f1b7ddd45208ce4185b4fafd
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Mon Dec 3 23:04:52 2012 +0100
Though shall close the parenthesis...
>---------------------------------------------------------------
fedocal/templates/master.html | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fedocal/templates/master.html b/fedocal/templates/master.html
index 34b625b..ec6039a 100644
--- a/fedocal/templates/master.html
+++ b/fedocal/templates/master.html
@@ -4,7 +4,7 @@
<html lang='en'>
<head>
<meta charset="utf-8" />
- <link rel="icon" type="image/x-icon" href="{{ url_for('static', filename='favicon.ico'}}" />
+ <link rel="icon" type="image/x-icon" href="{{ url_for('static', filename='favicon.ico')}}" />
<title>{% block title %}{% endblock %} - Fedocal</title>
<link rel="stylesheet" type="text/css" media="screen"
href="{{ url_for('static', filename='fedocal.css') }}" />
11 years, 4 months
[fedocal] master: Add the favicon from Mark Klein (9c3aa3e)
by Pierre-YvesChibon
Repository : http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
>---------------------------------------------------------------
commit 9c3aa3e2e4df647b997aa2b53d20e317567afb2a
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Mon Dec 3 23:01:11 2012 +0100
Add the favicon from Mark Klein
>---------------------------------------------------------------
fedocal/static/favicon.ico | Bin 0 -> 1218 bytes
fedocal/templates/master.html | 1 +
2 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/fedocal/static/favicon.ico b/fedocal/static/favicon.ico
new file mode 100644
index 0000000..e4db2c2
Binary files /dev/null and b/fedocal/static/favicon.ico differ
diff --git a/fedocal/templates/master.html b/fedocal/templates/master.html
index 96e5e6f..34b625b 100644
--- a/fedocal/templates/master.html
+++ b/fedocal/templates/master.html
@@ -4,6 +4,7 @@
<html lang='en'>
<head>
<meta charset="utf-8" />
+ <link rel="icon" type="image/x-icon" href="{{ url_for('static', filename='favicon.ico'}}" />
<title>{% block title %}{% endblock %} - Fedocal</title>
<link rel="stylesheet" type="text/css" media="screen"
href="{{ url_for('static', filename='fedocal.css') }}" />
11 years, 4 months
[fedocal] master: pep8 run on test_meeting (a045df3)
by Pierre-YvesChibon
Repository : http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
>---------------------------------------------------------------
commit a045df366b5e0bc172f067c890eb800a362c2cbc
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Mon Dec 3 22:21:14 2012 +0100
pep8 run on test_meeting
>---------------------------------------------------------------
fedocal/tests/test_meeting.py | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/fedocal/tests/test_meeting.py b/fedocal/tests/test_meeting.py
index 09257a4..b236c5c 100644
--- a/fedocal/tests/test_meeting.py
+++ b/fedocal/tests/test_meeting.py
@@ -133,7 +133,7 @@ class Meetingtests(Modeltests):
meeting_date_end=TODAY + timedelta(days=1),
meeting_time_start=time(14, 00),
meeting_time_stop=time(16, 00),
- meeting_information='This is a second test meeting at the'\
+ meeting_information='This is a second test meeting at the'
' same time',
calendar_name='test_calendar4',
meeting_region='EMEA')
@@ -201,7 +201,7 @@ class Meetingtests(Modeltests):
meeting_date_end=TODAY + timedelta(days=12),
meeting_time_start=time(10, 00),
meeting_time_stop=time(11, 00),
- meeting_information='This is a test meeting with recursion'\
+ meeting_information='This is a test meeting with recursion'
' and reminder',
calendar_name='test_calendar',
reminder_id=remobj.reminder_id,
@@ -246,9 +246,9 @@ class Meetingtests(Modeltests):
self.test_init_meeting()
obj = model.Meeting.by_id(self.session, 1)
self.assertNotEqual(obj, None)
- self.assertEqual(str(obj), '<Meeting(\'<Calendar(\'test_calendar\''\
- ')>\', \'Fedora-fr-test-meeting\', \'' + str(TODAY) \
- + '\')>')
+ self.assertEqual(str(obj), '<Meeting(\'<Calendar(\'test_calendar\''
+ ')>\', \'Fedora-fr-test-meeting\', \'' + str(TODAY) +
+ '\')>')
def test_delete_meeting(self):
""" Test the Meeting delete function. """
@@ -541,7 +541,6 @@ class Meetingtests(Modeltests):
self.assertEqual(meetings[3].meeting_name,
'Test meeting with reminder and recursion')
-
# pylint: disable=C0103
def test_get_future_regular_meeting_of_user_fail(self):
""" Test the Meeting get_future_regular_meeting_of_user function
11 years, 4 months
[fedocal] master: pep8 run on test_fedocallib (ecc1501)
by Pierre-YvesChibon
Repository : http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
>---------------------------------------------------------------
commit ecc15012e11881d3a0becf7998d95c10d39701af
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Mon Dec 3 22:19:36 2012 +0100
pep8 run on test_fedocallib
>---------------------------------------------------------------
fedocal/tests/test_fedocallib.py | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/fedocal/tests/test_fedocallib.py b/fedocal/tests/test_fedocallib.py
index f5b3389..60709f4 100644
--- a/fedocal/tests/test_fedocallib.py
+++ b/fedocal/tests/test_fedocallib.py
@@ -50,6 +50,7 @@ from fedocallib import model
from fedocallib.exceptions import UserNotAllowed, InvalidMeeting
from tests import Modeltests, TODAY, FakeUser
+
# pylint: disable=R0904
class Fedocallibtests(Modeltests):
""" Fedocallib tests. """
@@ -356,7 +357,6 @@ class Fedocallibtests(Modeltests):
self.assertEqual(meetings[3].meeting_information,
'This is a test meeting with recursion and reminder')
-
# pylint: disable=C0103
def test_get_future_regular_meeting_of_user_empty(self):
""" Test the get_future_regular_meeting_of_user function on a
@@ -581,7 +581,7 @@ class Fedocallibtests(Modeltests):
self.assertTrue('class="month"> %s </th>' % (
today.strftime('%B %Y')) in output)
# Check the current_week css class
- self.assertNotEqual(re.match('<tr class="current_week">.*'\
+ self.assertNotEqual(re.match('<tr class="current_week">.*'
'<td>%s</td>' % (today.day), output), [])
def test_get_week_day_index(self):
@@ -979,7 +979,7 @@ class Fedocallibtests(Modeltests):
self.assertEqual(meeting.meeting_information, 'Information2')
self.assertEqual(meeting.reminder.reminder_offset, 'H-24')
self.assertEqual(meeting.reminder.reminder_to, 'test(a)example.org')
- self.assertEqual(meeting.meeting_date_end, date.today() + \
+ self.assertEqual(meeting.meeting_date_end, date.today() +
timedelta(days=3))
meeting = model.Meeting.by_id(self.session, 9)
@@ -1001,7 +1001,7 @@ class Fedocallibtests(Modeltests):
self.assertEqual(meeting.meeting_information, 'Information2')
self.assertEqual(meeting.reminder.reminder_offset, 'H-24')
self.assertEqual(meeting.reminder.reminder_to, 'test(a)example.org')
- self.assertEqual(meeting.meeting_date_end, date.today() + \
+ self.assertEqual(meeting.meeting_date_end, date.today() +
timedelta(days=3))
11 years, 4 months
[fedocal] master: Fix new meeting date when editing recursive meeting (66e5cb9)
by Pierre-YvesChibon
Repository : http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
>---------------------------------------------------------------
commit 66e5cb922e78ecbfa90468d9a070867f3a9c889f
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Mon Dec 3 21:56:32 2012 +0100
Fix new meeting date when editing recursive meeting
The new meeting should refer to the date in the form not the date of the original meeting as the original meeting is the begining date of the
recursion while the date in the form can be the date from which the
recursion changes.
>---------------------------------------------------------------
fedocal/fedocallib/__init__.py | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/fedocal/fedocallib/__init__.py b/fedocal/fedocallib/__init__.py
index 4b78d61..6028606 100644
--- a/fedocal/fedocallib/__init__.py
+++ b/fedocal/fedocallib/__init__.py
@@ -751,7 +751,7 @@ def edit_meeting(session, meeting, calendarobj, fas_user,
if not edit_all_meeting:
remove_recursion = True
new_meeting = Meeting.copy(meeting)
- new_meeting.meeting_date = meeting.meeting_date + timedelta(
+ new_meeting.meeting_date = meeting_date + timedelta(
days=meeting.recursion_frequency)
free_time = agenda_is_free(session, calendarobj,
new_meeting.meeting_date,
@@ -762,7 +762,6 @@ def edit_meeting(session, meeting, calendarobj, fas_user,
bool(free_time):
new_meeting.save(session)
-
meeting_time_start = convert_time(
datetime(meeting_date.year, meeting_date.month, meeting_date.day,
meeting_time_start.hour,
11 years, 4 months
[fedocal] master: Add the entry in the form to edit one meeting or all of them in a recursion (2f15b71)
by Pierre-YvesChibon
Repository : http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
>---------------------------------------------------------------
commit 2f15b7103717d650653a4132485ae418362a2922
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Mon Dec 3 21:50:36 2012 +0100
Add the entry in the form to edit one meeting or all of them in a recursion
>---------------------------------------------------------------
fedocal/__init__.py | 2 +-
fedocal/forms.py | 3 +++
fedocal/templates/edit_meeting.html | 7 +++++--
3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/fedocal/__init__.py b/fedocal/__init__.py
index e717bd9..61fd7b0 100644
--- a/fedocal/__init__.py
+++ b/fedocal/__init__.py
@@ -375,7 +375,7 @@ def edit_meeting(meeting_id):
recursion_ends=form.end_repeats.data,
remind_when=form.remind_when.data,
remind_who=form.remind_who.data,
- edit_all_meeting=True)
+ edit_all_meeting=form.recursive_edit.data)
except FedocalException, err:
flask.flash(err)
return flask.render_template('edit_meeting.html',
diff --git a/fedocal/forms.py b/fedocal/forms.py
index a4dac15..6ca86d3 100644
--- a/fedocal/forms.py
+++ b/fedocal/forms.py
@@ -108,6 +108,9 @@ class AddMeetingForm(wtf.Form):
)
end_repeats = wtf.DateField('End date', [wtf.validators.optional()])
+ # Recursive edit
+ recursive_edit = wtf.BooleanField('Yes I want to edit all the meetings')
+
# Reminder
remind_when = wtf.SelectField('Send reminder',
[wtf.validators.optional()],
diff --git a/fedocal/templates/edit_meeting.html b/fedocal/templates/edit_meeting.html
index 8328753..a258361 100644
--- a/fedocal/templates/edit_meeting.html
+++ b/fedocal/templates/edit_meeting.html
@@ -43,8 +43,11 @@
{% if meeting.recursion_frequency %}
<h4>Edit all?</h4>
- <p>This meeting is a recursive meeting, your changes will
- affect all the meetings related.</p>
+ <p>This meeting is a recursive meeting, by default your
+ changes will only affect this meeting unless you explecitely
+ say otherwise:
+ </p>
+ {{ render_field_invert(form.recursive_edit) }}
{% endif %}
<p class="buttons indent">
11 years, 4 months
[fedocal] master: Split the test_edit_meeting into two tests one that works and one that fails (2a76dd7)
by Pierre-YvesChibon
Repository : http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
>---------------------------------------------------------------
commit 2a76dd796af1f6fae57b2b9d7bbc44d1cd556dae
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Mon Dec 3 21:31:01 2012 +0100
Split the test_edit_meeting into two tests one that works and one that fails
>---------------------------------------------------------------
fedocal/tests/test_fedocallib.py | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/fedocal/tests/test_fedocallib.py b/fedocal/tests/test_fedocallib.py
index 8269626..f5b3389 100644
--- a/fedocal/tests/test_fedocallib.py
+++ b/fedocal/tests/test_fedocallib.py
@@ -817,8 +817,8 @@ class Fedocallibtests(Modeltests):
self.assertEqual(meeting.meeting_information, 'Information')
self.assertEqual(meeting.meeting_time_stop.minute, 59)
- def test_edit_meeting(self):
- """ Test the edit_meeting function. """
+ def test_edit_meeting_fail(self):
+ """ Test the edit_meeting function for when edit fails. """
self.__setup_meeting()
calendarobj = model.Calendar.by_id(self.session, 'test_calendar')
self.assertNotEqual(calendarobj, None)
@@ -869,6 +869,15 @@ class Fedocallibtests(Modeltests):
None, None)
self.session.rollback()
+ def test_edit_meeting(self):
+ """ Test the edit_meeting function. """
+ self.__setup_meeting()
+ calendarobj = model.Calendar.by_id(self.session, 'test_calendar')
+ self.assertNotEqual(calendarobj, None)
+ fasuser = FakeUser(['fi-apprentice'])
+ meeting = model.Meeting.by_id(self.session, 1)
+ self.assertEqual(meeting.meeting_name, 'Fedora-fr-test-meeting')
+
fedocallib.edit_meeting(
self.session, meeting, calendarobj, fasuser,
'Fedora-fr-meeting_edited',
11 years, 4 months