[fedocal] master: Small pylint fix (baf8561)
by Pierre-YvesChibon
Repository : http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
>---------------------------------------------------------------
commit baf85613ab08c4fd232e94c0a6f7e7fd2f7f98f6
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Sun Feb 24 16:43:04 2013 +0100
Small pylint fix
>---------------------------------------------------------------
fedocal/forms.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fedocal/forms.py b/fedocal/forms.py
index b2512b3..3c8ab09 100644
--- a/fedocal/forms.py
+++ b/fedocal/forms.py
@@ -36,7 +36,7 @@ import fedocallib
def validate_time(form, field):
""" Validate if the data set in the given field is a valid time. """
import re
- if not re.match('\d?\d:\d\d?', field.data):
+ if not re.match(r'\d?\d:\d\d?', field.data):
raise ValidationError('Time must be of type "HH:MM"')
time_data = field.data.split(':')
try:
11 years, 2 months
[fedocal] master: Couple of changes in the spec file (69740fb)
by Pierre-YvesChibon
Repository : http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
>---------------------------------------------------------------
commit 69740fb3fdfd7247ac7a58bde4ad2a0e74339836
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Sun Feb 24 16:19:15 2013 +0100
Couple of changes in the spec file
- the directory in /etc is just a directory
- the config file in /etc/fedocal is what should be marked as config
>---------------------------------------------------------------
fedocal.spec | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/fedocal.spec b/fedocal.spec
index c62276e..13810aa 100644
--- a/fedocal.spec
+++ b/fedocal.spec
@@ -67,7 +67,8 @@ install -m 644 fedocal.cfg.sample $RPM_BUILD_ROOT/%{_sysconfdir}/fedocal/fedocal
%files
%doc README.rst LICENSE doc/
%config(noreplace) %{_sysconfdir}/httpd/conf.d/fedocal.conf
-%config(noreplace) %{_sysconfdir}/fedocal/
+%config(noreplace) %{_sysconfdir}/fedocal/fedocal.cfg
+%dir %{_sysconfdir}/fedocal/
%{python_sitelib}/*
11 years, 2 months
[fedocal] master: Fix import and improve code coverage by adding tests for functions missing them so far (237b523)
by Pierre-YvesChibon
Repository : http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
>---------------------------------------------------------------
commit 237b5232a12a08f8c3d24213640bb2e6ccfdd57e
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Sun Feb 24 16:06:40 2013 +0100
Fix import and improve code coverage by adding tests for functions missing them so far
>---------------------------------------------------------------
tests/test_meeting.py | 51 ++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 50 insertions(+), 1 deletions(-)
diff --git a/tests/test_meeting.py b/tests/test_meeting.py
index b12b17c..b1fc234 100644
--- a/tests/test_meeting.py
+++ b/tests/test_meeting.py
@@ -40,7 +40,7 @@ from datetime import timedelta
sys.path.insert(0, os.path.join(os.path.dirname(
os.path.abspath(__file__)), '..'))
-from fedocallib import model
+from fedocal.fedocallib import model
from tests import Modeltests, TODAY
from test_calendar import Calendartests
@@ -374,6 +374,38 @@ class Meetingtests(Modeltests):
'}' % (TODAY, TODAY)
self.assertEqual(obj.to_json(), exp)
+ def test_get_at_date(self):
+ """ Test the get_at_date function. """
+ self.test_init_meeting()
+ cal = model.Calendar.by_id(self.session, 'test_calendar')
+ obj = model.Meeting.get_at_date(self.session, cal,
+ TODAY)
+
+ self.assertNotEqual(obj, None)
+ self.assertEqual(len(obj), 2)
+ self.assertEqual(obj[0].meeting_name, 'Fedora-fr-test-meeting')
+ self.assertEqual(obj[0].meeting_manager, 'pingou, shaiton,')
+ self.assertEqual(obj[0].calendar.calendar_name, 'test_calendar')
+ self.assertEqual(obj[0].meeting_information,
+ 'This is a test meeting')
+ self.assertEqual(obj[0].reminder, None)
+
+ def test_get_at_time(self):
+ """ Test the get_at_time function. """
+ self.test_init_meeting()
+ cal = model.Calendar.by_id(self.session, 'test_calendar')
+ obj = model.Meeting.get_at_time(self.session, cal,
+ TODAY, time(20, 00))
+
+ self.assertNotEqual(obj, None)
+ self.assertEqual(len(obj), 1)
+ self.assertEqual(obj[0].meeting_name, 'Fedora-fr-test-meeting')
+ self.assertEqual(obj[0].meeting_manager, 'pingou, shaiton,')
+ self.assertEqual(obj[0].calendar.calendar_name, 'test_calendar')
+ self.assertEqual(obj[0].meeting_information,
+ 'This is a test meeting')
+ self.assertEqual(obj[0].reminder, None)
+
def test_get_by_date(self):
""" Test the query of a list of meetings between two dates. """
self.test_init_meeting()
@@ -536,6 +568,23 @@ class Meetingtests(Modeltests):
self.assertEqual(len(meetings), 0)
self.assertEqual(meetings, [])
+ def test_get_regular_meeting_at_date(self):
+ """ Test the get_regular_meeting_at_date function. """
+ self.test_init_meeting()
+ cal = model.Calendar.by_id(self.session, 'test_calendar')
+ obj = model.Meeting.get_regular_meeting_at_date(self.session,
+ cal, TODAY + timedelta(days=19))
+
+ self.assertNotEqual(obj, None)
+ self.assertEqual(len(obj), 1)
+ self.assertEqual(obj[0].meeting_name,
+ 'Test meeting with reminder and recursion')
+ self.assertEqual(obj[0].meeting_manager, 'pingou,')
+ self.assertEqual(obj[0].calendar.calendar_name, 'test_calendar')
+ self.assertEqual(obj[0].meeting_information,
+ 'This is a test meeting with recursion and reminder')
+ self.assertNotEqual(obj[0].reminder, None)
+
# pylint: disable=C0103
def test_get_future_single_meeting_of_user(self):
""" Test the Meeting get_future_single_meeting_of_user function.
11 years, 2 months
[fedocal] master: Fix imports (46e93ab)
by Pierre-YvesChibon
Repository : http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
>---------------------------------------------------------------
commit 46e93ab785d92956104f45680bb6508dad4dceba
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Sun Feb 24 16:06:12 2013 +0100
Fix imports
>---------------------------------------------------------------
tests/__init__.py | 2 +-
tests/test_calendar.py | 2 +-
tests/test_fedocallib.py | 6 +++---
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/tests/__init__.py b/tests/__init__.py
index 2c9a3ab..7c3cb54 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -44,7 +44,7 @@ from sqlalchemy.orm import scoped_session
sys.path.insert(0, os.path.join(os.path.dirname(
os.path.abspath(__file__)), '..'))
-from fedocallib import model, get_start_week
+from fedocal.fedocallib import model, get_start_week
DB_PATH = '%s/test.db' % (os.path.dirname(
os.path.abspath(__file__)))
diff --git a/tests/test_calendar.py b/tests/test_calendar.py
index f3ea640..c6d6779 100644
--- a/tests/test_calendar.py
+++ b/tests/test_calendar.py
@@ -37,7 +37,7 @@ import os
sys.path.insert(0, os.path.join(os.path.dirname(
os.path.abspath(__file__)), '..'))
-from fedocallib import model
+from fedocal.fedocallib import model
from tests import Modeltests
diff --git a/tests/test_fedocallib.py b/tests/test_fedocallib.py
index 6b1d71e..e547252 100644
--- a/tests/test_fedocallib.py
+++ b/tests/test_fedocallib.py
@@ -46,9 +46,9 @@ from sqlalchemy.exc import IntegrityError
sys.path.insert(0, os.path.join(os.path.dirname(
os.path.abspath(__file__)), '..'))
-import fedocallib
-from fedocallib import model
-from fedocallib.exceptions import UserNotAllowed, InvalidMeeting
+import fedocal.fedocallib as fedocallib
+from fedocal.fedocallib import model
+from fedocal.fedocallib.exceptions import UserNotAllowed, InvalidMeeting
from tests import Modeltests, TODAY, FakeUser
11 years, 2 months
[fedocal] master: Don't cover what we can safely ignore and fix the get_regular_meeting_at_date method (67f9eed)
by Pierre-YvesChibon
Repository : http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
>---------------------------------------------------------------
commit 67f9eedefc5c9875c3400c817cdef6627144c08b
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Sun Feb 24 16:05:57 2013 +0100
Don't cover what we can safely ignore and fix the get_regular_meeting_at_date method
>---------------------------------------------------------------
fedocal/fedocallib/model.py | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/fedocal/fedocallib/model.py b/fedocal/fedocallib/model.py
index e5aefee..24e218c 100644
--- a/fedocal/fedocallib/model.py
+++ b/fedocal/fedocallib/model.py
@@ -59,7 +59,7 @@ def create_tables(db_url, alembic_ini=None, debug=False):
engine = create_engine(db_url, echo=debug)
BASE.metadata.create_all(engine)
- if alembic_ini is not None:
+ if alembic_ini is not None: # pragma: no cover
# then, load the Alembic configuration and generate the
# version table, "stamping" it with the most recent rev:
from alembic.config import Config
@@ -347,10 +347,14 @@ class Meeting(BASE):
""" Retrieve the list of recursive meetings happening at the
specified end_date.
"""
- meetings = cls.expand_regular_meetings(
+ meetings_tmp = cls.expand_regular_meetings(
cls.get_active_regular_meeting(session, calendar,
end_date, full_day),
end_date)
+ meetings = []
+ for meeting in meetings_tmp:
+ if meeting.meeting_date == end_date:
+ meetings.append(meeting)
return meetings
@classmethod
@@ -500,7 +504,7 @@ class Meeting(BASE):
"""
meetings = []
for meeting in meetings_in:
- if not end_date:
+ if not end_date: # pragma: no cover
end_date = meeting.recursion_ends
if meeting.recursion_frequency and meeting.recursion_ends:
meeting_date = meeting.meeting_date
11 years, 2 months
[fedocal] master: Last fixes to the setup.py for a proper installation (980d7fd)
by Pierre-YvesChibon
Repository : http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
>---------------------------------------------------------------
commit 980d7fdbeaa985999afd8f1aacd9c167f3242c1c
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Sun Feb 24 14:43:45 2013 +0100
Last fixes to the setup.py for a proper installation
Since we moved the tests one level higher, we can safely include
recursively the content of the fedocal folder which also simplifies
the setup.py
>---------------------------------------------------------------
MANIFEST.in | 1 +
setup.py | 4 +---
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/MANIFEST.in b/MANIFEST.in
index 67d020a..bacfd1a 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -2,5 +2,6 @@ include LICENSE README.rst *.sample requirements.txt
include fedocal.spec fedocal.wsgi fedocal.conf
include run_tests.sh createdb createdb.py
recursive-include alembic *
+recursive-include fedocal *
include doc/*
diff --git a/setup.py b/setup.py
index 709e581..4133ee0 100644
--- a/setup.py
+++ b/setup.py
@@ -18,9 +18,7 @@ setup(
license = 'GPLv3+',
download_url = 'https://fedorahosted.org/releases/f/e/fedocal/',
url = 'https://fedorahosted.org/fedocal/',
- packages=['fedocal', 'fedocal.fedocallib'],
- include_package_data = True,
- exclude_package_data={'': ['tests/*']},
+ packages=['fedocal'],
install_requires=['Flask', 'SQLAlchemy>=0.6', 'wtforms', 'flask-wtf',
'vobject', 'kitchen', 'python-fedora', 'pytz', 'python-dateutil<=1.5',
'alembic'],
11 years, 2 months
[fedocal] master: Fix the running of the tests after having moved them (ee0f724)
by Pierre-YvesChibon
Repository : http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
>---------------------------------------------------------------
commit ee0f72475bea848cee69686c8716c058544cdfb0
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Sun Feb 24 14:35:55 2013 +0100
Fix the running of the tests after having moved them
>---------------------------------------------------------------
run_tests.sh | 2 +-
tests/test_flask.py | 2 +-
tests/test_flask_api.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/run_tests.sh b/run_tests.sh
index 06434b8..639cb3e 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-erase --cover-package=fedocal $*
+FEDOCAL_CONFIG=../tests/fedocal_test.cfg PYTHONPATH=fedocal nosetests --with-coverage --cover-erase --cover-package=fedocal $*
diff --git a/tests/test_flask.py b/tests/test_flask.py
index ba4525a..eb05dce 100644
--- a/tests/test_flask.py
+++ b/tests/test_flask.py
@@ -42,7 +42,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(
import fedocal
import fedocal.fedocallib as fedocallib
-from fedocal.tests import Modeltests, DB_PATH, FakeUser
+from tests import Modeltests, DB_PATH, FakeUser
# pylint: disable=E1103
diff --git a/tests/test_flask_api.py b/tests/test_flask_api.py
index 9f4fb7e..93a4daf 100644
--- a/tests/test_flask_api.py
+++ b/tests/test_flask_api.py
@@ -41,7 +41,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(
import fedocal
import fedocal.fedocallib as fedocallib
-from fedocal.tests import Modeltests, DB_PATH, TODAY
+from tests import Modeltests, DB_PATH, TODAY
# pylint: disable=E1103
11 years, 2 months
[fedocal] master: Move the tests one level higher in the filesystem (5ccafb4)
by Pierre-YvesChibon
Repository : http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
>---------------------------------------------------------------
commit 5ccafb4fd4df48dc55bd9ab534c0c65ed1803045
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Sun Feb 24 14:22:56 2013 +0100
Move the tests one level higher in the filesystem
This makes packaging easier
>---------------------------------------------------------------
{fedocal/tests => tests}/__init__.py | 0
{fedocal/tests => tests}/fedocal_test.cfg | 0
{fedocal/tests => tests}/test_calendar.py | 0
{fedocal/tests => tests}/test_fedocallib.py | 0
{fedocal/tests => tests}/test_fedora_calendar.py | 0
{fedocal/tests => tests}/test_flask.py | 0
{fedocal/tests => tests}/test_flask_api.py | 0
{fedocal/tests => tests}/test_meeting.py | 0
{fedocal/tests => tests}/test_reminder.py | 0
{fedocal/tests => tests}/test_week.py | 0
10 files changed, 0 insertions(+), 0 deletions(-)
diff --git a/fedocal/tests/__init__.py b/tests/__init__.py
similarity index 100%
rename from fedocal/tests/__init__.py
rename to tests/__init__.py
diff --git a/fedocal/tests/fedocal_test.cfg b/tests/fedocal_test.cfg
similarity index 100%
rename from fedocal/tests/fedocal_test.cfg
rename to tests/fedocal_test.cfg
diff --git a/fedocal/tests/test_calendar.py b/tests/test_calendar.py
similarity index 100%
rename from fedocal/tests/test_calendar.py
rename to tests/test_calendar.py
diff --git a/fedocal/tests/test_fedocallib.py b/tests/test_fedocallib.py
similarity index 100%
rename from fedocal/tests/test_fedocallib.py
rename to tests/test_fedocallib.py
diff --git a/fedocal/tests/test_fedora_calendar.py b/tests/test_fedora_calendar.py
similarity index 100%
rename from fedocal/tests/test_fedora_calendar.py
rename to tests/test_fedora_calendar.py
diff --git a/fedocal/tests/test_flask.py b/tests/test_flask.py
similarity index 100%
rename from fedocal/tests/test_flask.py
rename to tests/test_flask.py
diff --git a/fedocal/tests/test_flask_api.py b/tests/test_flask_api.py
similarity index 100%
rename from fedocal/tests/test_flask_api.py
rename to tests/test_flask_api.py
diff --git a/fedocal/tests/test_meeting.py b/tests/test_meeting.py
similarity index 100%
rename from fedocal/tests/test_meeting.py
rename to tests/test_meeting.py
diff --git a/fedocal/tests/test_reminder.py b/tests/test_reminder.py
similarity index 100%
rename from fedocal/tests/test_reminder.py
rename to tests/test_reminder.py
diff --git a/fedocal/tests/test_week.py b/tests/test_week.py
similarity index 100%
rename from fedocal/tests/test_week.py
rename to tests/test_week.py
11 years, 2 months
[fedocal] master: List dependencies in the setup.py (365823a)
by Pierre-YvesChibon
Repository : http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
>---------------------------------------------------------------
commit 365823af662cfb2325a8727825d59ac93f3128cb
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Mon Feb 18 08:56:35 2013 +0100
List dependencies in the setup.py
>---------------------------------------------------------------
setup.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/setup.py b/setup.py
index ee78147..709e581 100644
--- a/setup.py
+++ b/setup.py
@@ -21,5 +21,7 @@ setup(
packages=['fedocal', 'fedocal.fedocallib'],
include_package_data = True,
exclude_package_data={'': ['tests/*']},
- install_requires=['Flask']
+ install_requires=['Flask', 'SQLAlchemy>=0.6', 'wtforms', 'flask-wtf',
+ 'vobject', 'kitchen', 'python-fedora', 'pytz', 'python-dateutil<=1.5',
+ 'alembic'],
)
11 years, 2 months
[fedocal] master: Hey look, fedocal depends on wsgi also (3ef277e)
by Pierre-YvesChibon
Repository : http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
>---------------------------------------------------------------
commit 3ef277e2439a5861a9f35e6f00ee347048425d1b
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Fri Feb 15 21:54:14 2013 +0100
Hey look, fedocal depends on wsgi also
>---------------------------------------------------------------
fedocal.spec | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/fedocal.spec b/fedocal.spec
index 97c3270..c62276e 100644
--- a/fedocal.spec
+++ b/fedocal.spec
@@ -34,6 +34,7 @@ Requires: python-fedora
Requires: python-alembic
Requires: python-dateutil <= 1.5
Requires: python-setuptools
+Requires: mod_wsgi
%description
fedocal is a web- based calendar application for Fedora. It aims at replacing
11 years, 3 months