From: philipp Date: Sun, 6 Aug 2017 18:49:57 +0000 (+0000) Subject: Moved tests directory. X-Git-Url: https://git.toastfreeware.priv.at/philipp/winterrodeln/wradmin.git/commitdiff_plain/0f7e7c71a34871a619abf55742e9708f9501abfd Moved tests directory. git-svn-id: http://www.winterrodeln.org/svn/wradmin/trunk@2699 7aebc617-e5e2-0310-91dc-80fb5f6d2477 --- diff --git a/tests/functional/__init__.py b/tests/functional/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/functional/test_bericht.py b/tests/functional/test_bericht.py new file mode 100644 index 0000000..57b88ec --- /dev/null +++ b/tests/functional/test_bericht.py @@ -0,0 +1,11 @@ +from wradmin.tests import * + +class TestBerichtController(TestController): + + def test_list(self): + response = self.app.get(url(controller='bericht', action='list')) + # Test response... + + def test_view(self): + response = self.app.get(url(controller='bericht', action='view', id=100)) + # Test response... diff --git a/tests/functional/test_coordtool.py b/tests/functional/test_coordtool.py new file mode 100644 index 0000000..a7c46a3 --- /dev/null +++ b/tests/functional/test_coordtool.py @@ -0,0 +1,7 @@ +from wradmin.tests import * + +class TestCoordtoolController(TestController): + + def test_index(self): + response = self.app.get(url(controller='coordtool', action='index')) + # Test response... diff --git a/tests/functional/test_rodelbahn.py b/tests/functional/test_rodelbahn.py new file mode 100644 index 0000000..4053de3 --- /dev/null +++ b/tests/functional/test_rodelbahn.py @@ -0,0 +1,17 @@ +from wradmin.tests import * + +class TestRodelbahnController(TestController): + + def test_index(self): + response = self.app.get(url(controller='rodelbahn', action='index')) + # Test response... + + + def test_list(self): + response = self.app.get(url(controller='rodelbahn', action='list')) + # Test response... + + + def test_view(self): + response = self.app.get(url(controller='rodelbahn', action='view', id=5)) + # Test response... \ No newline at end of file diff --git a/tests/functional/test_wrgpxtool.py b/tests/functional/test_wrgpxtool.py new file mode 100644 index 0000000..db22a41 --- /dev/null +++ b/tests/functional/test_wrgpxtool.py @@ -0,0 +1,7 @@ +from wradmin.tests import * + +class TestWrgpxtoolController(TestController): + + def test_index(self): + response = self.app.get(url(controller='wrgpxtool', action='index')) + # Test response... diff --git a/tests/test_lib.py b/tests/test_lib.py new file mode 100644 index 0000000..f73fc53 --- /dev/null +++ b/tests/test_lib.py @@ -0,0 +1,24 @@ +#!/usr/bin/python3.4 +# $Id$ +import unittest +import wradmin.lib +import wradmin.lib.mediawiki +import wradmin.model + + +class TestMediaWikiUsers(unittest.TestCase): + + @unittest.skip + def test_mediawiki_users(self): + users = wradmin.lib.mediawiki.MediaWikiUsers(True) + assert len(users.usernames) >= 1 # We have at least one user + + def test_mediawiki_users_has_password_is_correct_b(self): + password_db = ':B:d25b2886:41e46c952790b1b442aac4f24f7ea7a8' # 'abc' + self.assertTrue(wradmin.lib.mediawiki.MediaWikiUsers.password_is_correct('abc', password_db)) + self.assertFalse(wradmin.lib.mediawiki.MediaWikiUsers.password_is_correct('abcd', password_db)) + + def test_mediawiki_users_has_password_is_correct_pbkdf2(self): + password_db = ':pbkdf2:sha256:10000:128:EXgVGhc2mAs710feKvkiaw==:J5fYth9pg/R2d0F8bSsYfTR8SBpTBNIcdv/DgJ0tOPC1rtajl2Dr0RLqOozLb8O0XpDhtv4a3JJd/M0b58WebfNWAcdJBJI9nNeC0EYYD7OCYZGVAaRhiYtK4m53KZBBL6x/k2j4RjHPT1NmgV8Fr1DPqBNOlOHxUIh5z5oslM4=' # 'abc' + self.assertTrue(wradmin.lib.mediawiki.MediaWikiUsers.password_is_correct('abc', password_db)) + self.assertFalse(wradmin.lib.mediawiki.MediaWikiUsers.password_is_correct('abcd', password_db)) diff --git a/wradmin/tests/functional/__init__.py b/wradmin/tests/functional/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/wradmin/tests/functional/test_bericht.py b/wradmin/tests/functional/test_bericht.py deleted file mode 100644 index 57b88ec..0000000 --- a/wradmin/tests/functional/test_bericht.py +++ /dev/null @@ -1,11 +0,0 @@ -from wradmin.tests import * - -class TestBerichtController(TestController): - - def test_list(self): - response = self.app.get(url(controller='bericht', action='list')) - # Test response... - - def test_view(self): - response = self.app.get(url(controller='bericht', action='view', id=100)) - # Test response... diff --git a/wradmin/tests/functional/test_coordtool.py b/wradmin/tests/functional/test_coordtool.py deleted file mode 100644 index a7c46a3..0000000 --- a/wradmin/tests/functional/test_coordtool.py +++ /dev/null @@ -1,7 +0,0 @@ -from wradmin.tests import * - -class TestCoordtoolController(TestController): - - def test_index(self): - response = self.app.get(url(controller='coordtool', action='index')) - # Test response... diff --git a/wradmin/tests/functional/test_rodelbahn.py b/wradmin/tests/functional/test_rodelbahn.py deleted file mode 100644 index 4053de3..0000000 --- a/wradmin/tests/functional/test_rodelbahn.py +++ /dev/null @@ -1,17 +0,0 @@ -from wradmin.tests import * - -class TestRodelbahnController(TestController): - - def test_index(self): - response = self.app.get(url(controller='rodelbahn', action='index')) - # Test response... - - - def test_list(self): - response = self.app.get(url(controller='rodelbahn', action='list')) - # Test response... - - - def test_view(self): - response = self.app.get(url(controller='rodelbahn', action='view', id=5)) - # Test response... \ No newline at end of file diff --git a/wradmin/tests/functional/test_wrgpxtool.py b/wradmin/tests/functional/test_wrgpxtool.py deleted file mode 100644 index db22a41..0000000 --- a/wradmin/tests/functional/test_wrgpxtool.py +++ /dev/null @@ -1,7 +0,0 @@ -from wradmin.tests import * - -class TestWrgpxtoolController(TestController): - - def test_index(self): - response = self.app.get(url(controller='wrgpxtool', action='index')) - # Test response... diff --git a/wradmin/tests/test_lib.py b/wradmin/tests/test_lib.py deleted file mode 100644 index f73fc53..0000000 --- a/wradmin/tests/test_lib.py +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/python3.4 -# $Id$ -import unittest -import wradmin.lib -import wradmin.lib.mediawiki -import wradmin.model - - -class TestMediaWikiUsers(unittest.TestCase): - - @unittest.skip - def test_mediawiki_users(self): - users = wradmin.lib.mediawiki.MediaWikiUsers(True) - assert len(users.usernames) >= 1 # We have at least one user - - def test_mediawiki_users_has_password_is_correct_b(self): - password_db = ':B:d25b2886:41e46c952790b1b442aac4f24f7ea7a8' # 'abc' - self.assertTrue(wradmin.lib.mediawiki.MediaWikiUsers.password_is_correct('abc', password_db)) - self.assertFalse(wradmin.lib.mediawiki.MediaWikiUsers.password_is_correct('abcd', password_db)) - - def test_mediawiki_users_has_password_is_correct_pbkdf2(self): - password_db = ':pbkdf2:sha256:10000:128:EXgVGhc2mAs710feKvkiaw==:J5fYth9pg/R2d0F8bSsYfTR8SBpTBNIcdv/DgJ0tOPC1rtajl2Dr0RLqOozLb8O0XpDhtv4a3JJd/M0b58WebfNWAcdJBJI9nNeC0EYYD7OCYZGVAaRhiYtK4m53KZBBL6x/k2j4RjHPT1NmgV8Fr1DPqBNOlOHxUIh5z5oslM4=' # 'abc' - self.assertTrue(wradmin.lib.mediawiki.MediaWikiUsers.password_is_correct('abc', password_db)) - self.assertFalse(wradmin.lib.mediawiki.MediaWikiUsers.password_is_correct('abcd', password_db))