Added further tests for inn_from_gasthausbox.
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Sun, 29 Jan 2017 22:18:49 +0000 (22:18 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Sun, 29 Jan 2017 22:18:49 +0000 (22:18 +0000)
git-svn-id: http://www.winterrodeln.org/svn/wrpylib/trunk@2621 7aebc617-e5e2-0310-91dc-80fb5f6d2477

tests/test_wrmwmarkup.py

index 972ff17510a704d1b26c539b92098952a0136738..98f9067fc94ed0ee1fa199f9891ca83c82a8a846 100644 (file)
@@ -207,6 +207,44 @@ class TestInn(unittest.TestCase):
         self.assertEqual(gasthausbox['Bild'], 'Gasthaus_Graf_Ferdinand_Haus_01.jpg')
         self.assertEqual(gasthausbox['Rodelbahnen'], ['[[Finstertaler Speicher]]'])
 
+    def test_inn_from_gasthausbox_none(self):
+        class Inn:
+            pass
+        gasthausbox = collections.OrderedDict()
+        gasthausbox['Position'] = LonLat(None, None)
+        gasthausbox['Höhe'] = None
+        gasthausbox['Betreiber'] = None
+        gasthausbox['Sitzplätze'] = None
+        gasthausbox['Übernachtung'] = (None, None)
+        gasthausbox['Rauchfrei'] = None
+        gasthausbox['Rodelverleih'] = (None, None)
+        gasthausbox['Handyempfang'] = None
+        gasthausbox['Homepage'] = (None, None)
+        gasthausbox['E-Mail'] = None
+        gasthausbox['Telefon'] = None
+        gasthausbox['Bild'] = None
+        gasthausbox['Rodelbahnen'] = None
+        inn = Inn()
+        inn_from_gasthausbox(gasthausbox, inn)
+        self.assertEqual(inn.position_latitude, None)
+        self.assertEqual(inn.position_longitude, None)
+        self.assertEqual(inn.position_elevation, None)
+        self.assertEqual(inn.operator, None)
+        self.assertEqual(inn.seats, None)
+        self.assertEqual(inn.overnight, None)
+        self.assertEqual(inn.overnight_comment, None)
+        self.assertEqual(inn.smoker_area, None)
+        self.assertEqual(inn.nonsmoker_area, None)
+        self.assertEqual(inn.sled_rental, None)
+        self.assertEqual(inn.sled_rental_comment, None)
+        self.assertEqual(inn.mobile_provider, None)
+        self.assertEqual(inn.homepage, None)
+        self.assertEqual(inn.email_list, None)
+        self.assertEqual(inn.phone_list, None)
+        self.assertEqual(inn.image, None)
+        self.assertEqual(inn.sledding_list, None)
+
+
 
 class TestLonlatEle(unittest.TestCase):
     def test_lonlat_ele_from_template(self):