-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
44 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,10 +96,25 @@ jobs: | |
postgresql password: pass | ||
if: matrix.database == 'postgres' | ||
|
||
- name: Setup postgres dependency | ||
run: | | ||
source env/bin/activate | ||
poetry add psycopg2 | ||
if: matrix.database == 'postgres' | ||
|
||
#- uses: mirromutth/[email protected] | ||
# with: | ||
# mysql database: 'myHPI' | ||
# mysql root password: 'root' | ||
# if: matrix.database == 'mysql' | ||
|
||
- name: Setup mysql | ||
run: | | ||
sudo systemctl start mysql.service | ||
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -uroot -proot -Dmysql | ||
echo "CREATE DATABASE myHPI;" | mysql -uroot -proot | ||
source env/bin/activate | ||
poetry add mysqlclient | ||
if: matrix.database == 'mysql' | ||
|
||
- name: Test apps | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import django | ||
import pytest | ||
from django.test import TestCase | ||
|
||
django.setup() | ||
|
||
from myhpi.wagtail_markdown.minutes_extensions import EnterLeavePreprocessor | ||
|
||
|
||
class TestMinuteExtensions(TestCase): | ||
def test_enter(self): | ||
elp = EnterLeavePreprocessor() | ||
text = [ | ||
"|enter|(12:00)(First Last)", | ||
"|enter|(12:00)(Prof. First Last)", | ||
"|enter|(12:00)(Prof. First Last)(Means)", | ||
"|leave|(12:00)(Prof. First Last)", | ||
] | ||
result = elp.run(text) | ||
self.assertEqual( | ||
result, | ||
[ | ||
"*12:00: First Last enters the meeting* ", | ||
"*12:00: Prof. First Last enters the meeting* ", | ||
"*12:00: Prof. First Last enters the meeting via Means* ", | ||
"*12:00: Prof. First Last leaves the meeting* ", | ||
], | ||
) |