From 193765d8c89c76e54109ea343217ba273f2a9f9d Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 30 Aug 2017 16:06:09 +0200 Subject: vvs_efa: init --- vvs_efa/tests/__init__.py | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 vvs_efa/tests/__init__.py (limited to 'vvs_efa/tests') diff --git a/vvs_efa/tests/__init__.py b/vvs_efa/tests/__init__.py new file mode 100644 index 0000000..bbb1bcf --- /dev/null +++ b/vvs_efa/tests/__init__.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +import unittest +import datetime as dt +from vvs_efa import VVS_EFA + +vvs_efa = VVS_EFA.VVS_EFA() + +class TestConvertNameToId(unittest.TestCase): + + def test_stadtbibliothek_name(self): + self.assertEqual(vvs_efa.convertNameToId("Stadtbibliothek"), "5006116") + + def test_hauptbahnhof_name(self): + self.assertEqual(vvs_efa.convertNameToId("Hauptbahnhof"), "5006118") + + def test_name_with_umlaut(self): + self.assertEqual(vvs_efa.convertNameToId("Möhringen"), "5006169") + + def test_name_with_scharfs(self): + self.assertEqual(vvs_efa.convertNameToId("Vaihinger Straße"), "5000170") + + def test_stadtbibliothek_name_mobile(self): + self.assertEqual(vvs_efa.convertNameToId("Stadtbibliothek", True), "5006116") + + def test_hauptbahnhof_name_mobile(self): + self.assertEqual(vvs_efa.convertNameToId("Hauptbahnhof", True), "5006118") + + def test_empty_name(self): + self.assertEqual(vvs_efa.convertNameToId(""), None) + +class TestGetNextConnections(unittest.TestCase): + + def test_invalid_origin(self): + with self.assertRaises(TypeError): + vvs_efa.getNextConnections("", "Feuersee", dt.datetime(2015, 7, 13, 7, 20), True) + +if __name__ == '__main__': + unittest.main() -- cgit v1.2.3 [cgit] Unable to lock slot /tmp/cgit/48200000.lock: No such file or directory (2)