[gsoc-admin] Add parse_event_config test
- From: Lasse Schuirmann <lschuirma src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gsoc-admin] Add parse_event_config test
- Date: Fri, 6 Nov 2015 00:36:20 +0000 (UTC)
commit 60d45a35a4f6344052d52b1c217528d53b062d4a
Author: Lasse Schuirmann <lasse schuirmann gmail com>
Date: Thu Nov 5 11:16:30 2015 +0100
Add parse_event_config test
README.md | 4 ++++
tests/config_test.py | 41 ++++++++++++++++++++++++++++++++++++++++-
2 files changed, 44 insertions(+), 1 deletions(-)
---
diff --git a/README.md b/README.md
index 317831b..c859155 100644
--- a/README.md
+++ b/README.md
@@ -3,3 +3,7 @@
This repository holds scripts for automating GSoC administration.
See https://wiki.gnome.org/Outreach/SummerOfCode/2016/AdminIdeas
+
+# Tests
+
+To execute tests, just run `python3 -m pytest`.
diff --git a/tests/config_test.py b/tests/config_test.py
index 72c227a..ac92ff7 100644
--- a/tests/config_test.py
+++ b/tests/config_test.py
@@ -1,6 +1,6 @@
import datetime
import unittest
-from maillib.config import apply_substitutions
+from maillib.config import apply_substitutions, parse_event_config
class ModuleTest(unittest.TestCase):
@@ -9,3 +9,42 @@ class ModuleTest(unittest.TestCase):
self.assertEqual(apply_substitutions("some/{year}"),
"some/"+str(now.year))
self.assertEqual(apply_substitutions("some/year"), "some/year")
+
+ def test_parse_config(self):
+ config = parse_event_config("data/config.cfg")
+ self.assertEqual(config.mail_templates[0].text, """Dear interns, mentors and GNOME contributors,
+
+we hereby welcome all our interns and are happy to have our awesome
+mentors with us: {mentors} - welcome everyone!
+
+Cheers,
+
+Your GSoC Administrators
+
+---
+
+{projects}
+""")
+ self.assertEqual(config.mail_templates[0].get_specific(), """Dear interns, mentors and GNOME
contributors,
+
+we hereby welcome all our interns and are happy to have our awesome
+mentors with us: Zeeshan Ali Khattak, Christophe Fergeau - welcome everyone!
+
+Cheers,
+
+Your GSoC Administrators
+
+---
+
+Name: Lasse Schuirmann
+Mail: lasse schuirmann gmail com
+Mentor: Zeeshan Ali Khattak
+Project: Boxes
+
+Name: Alexandre Franke
+Mail: afranke gnome org
+Mentor: Christophe Fergeau
+Project: GSoC Administration
+
+""")
+ self.assertEqual(config.mail_templates[0].subject, 'Welcome Interns!')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]