From 20dc238c97708eca28ad1a0e44b630e83f7c4809 Mon Sep 17 00:00:00 2001 From: philipp Date: Fri, 27 Jan 2017 22:04:04 +0000 Subject: [PATCH 1/1] Removed tests for functions that are not used anymore. git-svn-id: http://www.winterrodeln.org/svn/wrpylib/trunk@2609 7aebc617-e5e2-0310-91dc-80fb5f6d2477 --- tests/test_wrmwmarkup.py | 206 +-------------------------------------- 1 file changed, 1 insertion(+), 205 deletions(-) diff --git a/tests/test_wrmwmarkup.py b/tests/test_wrmwmarkup.py index d6d1eef..972ff17 100644 --- a/tests/test_wrmwmarkup.py +++ b/tests/test_wrmwmarkup.py @@ -220,211 +220,7 @@ class TestLonlatEle(unittest.TestCase): self.assertEqual('{{Position oben|46.942239 N 11.468819 E|1866}}', template) -class TestWrMwMarkup(unittest.TestCase): - def test_rodelbahnbox_to_sledrun(self): - wikitext = '''== Allgemeines == - {{Rodelbahnbox - | Position = 47.309820 N 9.986508 E - | Position oben = - | Höhe oben = 1244 - | Position unten = - | Höhe unten = 806 - | Länge = 5045 - | Schwierigkeit = - | Lawinen = gelegentlich - | Betreiber = - | Öffentliche Anreise = Ja - | Gehzeit = 105 - | Aufstieg möglich = Nein - | Aufstieg getrennt = Nein - | Aufstiegshilfe = Nein - | Beleuchtungsanlage = Nein - | Beleuchtungstage = - | Rodelverleih = Ja - | Gütesiegel = - | Webauskunft = - | Telefonauskunft = +43-664-1808482 (Bergkristallhütte) - | Bild = Rodelbahn Bergkristallhütte 2009-03-03.jpg - | In Übersichtskarte = Ja - | Forumid = 72 - }} - Die Rodelbahn zur Bergkristallhütte ist durchaus abwechslungsreich.''' - start, end, sledrun = wrpylib.wrmwmarkup.rodelbahnbox_to_sledrun(wikitext) - wrpylib.wrmwmarkup.sledrun_to_rodelbahnbox(sledrun) - - - def test_RodelbahnboxDictConverter(self): - v = wrpylib.wrmwmarkup.RodelbahnboxDictConverter() - - sledrun = v.to_python(other) - assert sledrun.forum_id == 72 - other2 = v.from_python(sledrun) - assert other == other2 - - - def test_RodelbahnboxValidator(self): - v = wrpylib.wrmwmarkup.RodelbahnboxValidator() - wikitext = textwrap.dedent('''\ - {{Rodelbahnbox - | Position = 47.309820 N 9.986508 E - | Position oben = - | Höhe oben = 1244 - | Position unten = - | Höhe unten = 806 - | Länge = 5045 - | Schwierigkeit = - | Lawinen = gelegentlich - | Betreiber = - | Öffentliche Anreise = Ja - | Aufstieg möglich = Nein - | Aufstieg getrennt = Nein - | Gehzeit = 105 - | Aufstiegshilfe = Nein - | Beleuchtungsanlage = Nein - | Beleuchtungstage = - | Rodelverleih = Ja - | Gütesiegel = - | Webauskunft = - | Telefonauskunft = +43-664-1808482 (Bergkristallhütte) - | Bild = Rodelbahn Bergkristallhütte 2009-03-03.jpg - | In Übersichtskarte = Ja - | Forumid = 72 - }}''') - sledrun = v.to_python(wikitext) - wikitext2 = v.from_python(sledrun) - assert wikitext == wikitext2 - wikitext = textwrap.dedent('''\ - {{Rodelbahnbox - | Position = - | Position oben = - | Höhe oben = - | Position unten = - | Höhe unten = - | Länge = - | Schwierigkeit = - | Lawinen = - | Betreiber = - | Öffentliche Anreise = - | Aufstieg möglich = - | Aufstieg getrennt = - | Gehzeit = - | Aufstiegshilfe = - | Beleuchtungsanlage = - | Beleuchtungstage = - | Rodelverleih = - | Gütesiegel = - | Webauskunft = - | Telefonauskunft = - | Bild = - | In Übersichtskarte = - | Forumid = - }}''') - sledrun = v.to_python(wikitext) - wikitext2 = v.from_python(sledrun) - assert wikitext == wikitext2 - - - def test_gasthausbox_to_inn(self): - wikitext = '''{{Gasthausbox - | Position = 47.295549 N 9.986970 E - | Höhe = 1250 - | Betreiber = - | Sitzplätze = - | Übernachtung = - | Rauchfrei = Nein - | Rodelverleih = - | Handyempfang = A1; T-Mobile/Telering - | Homepage = http://www.bergkristallhuette.com/ - | E-Mail = bergkristallhuette@gmx.at - | Telefon = +43-664-1808482 - | Bild = Bergkritsallhütte 2009-02-07.JPG - | Rodelbahnen = [[Bergkristallhütte]] - }} - Die Bergkristallhütte ist Teil des Boden-Vorsäß.''' - start, end, inn = wrpylib.wrmwmarkup.gasthausbox_to_inn(wikitext) - wrpylib.wrmwmarkup.inn_to_gasthausbox(inn) - - - def test_GasthausboxDictConverter(self): - v = wrpylib.wrmwmarkup.GasthausboxDictConverter() - other = collections.OrderedDict([ - ('Position', (47.295549, 9.986970)), - ('Höhe', 1250), - ('Betreiber', None), - ('Sitzplätze', None), - ('Übernachtung', (None, None)), - ('Rauchfrei', (True, False)), - ('Rodelverleih', (None, None)), - ('Handyempfang', 'A1; T-Mobile/Telering'), - ('Homepage', 'http://www.bergkristallhuette.com/'), - ('E-Mail', 'bergkristallhuette@gmx.at'), - ('Telefon', '+43-664-1808482'), - ('Bild', 'Bergkritsallhütte 2009-02-07.JPG'), - ('Rodelbahnen', '[[Bergkristallhütte]]')]) - inn = v.to_python(other) - assert inn.homepage == 'http://www.bergkristallhuette.com/' - other2 = v.from_python(inn) - assert other == other2 - - - def test_GasthausboxValidator(self): - v = wrpylib.wrmwmarkup.GasthausboxValidator() - wikitext = textwrap.dedent('''\ - {{Gasthausbox - | Position = 47.295549 N 9.986970 E - | Höhe = 1250 - | Betreiber = - | Sitzplätze = - | Übernachtung = - | Rauchfrei = Nein - | Rodelverleih = - | Handyempfang = A1; T-Mobile/Telering - | Homepage = http://www.bergkristallhuette.com/ - | E-Mail = bergkristallhuette@gmx.at - | Telefon = +43-664-1808482 - | Bild = Bergkritsallhütte 2009-02-07.JPG - | Rodelbahnen = [[Bergkristallhütte]] - }}''') - inn = v.to_python(wikitext) - wikitext2 = v.from_python(inn) - assert wikitext == wikitext2 - - - def test_googlemap_to_wrmap(self): - wikitext = ''' - - (Parkplatz)47.114958,11.266026 - Erster Parkplatz - - (Gasthaus) 47.114715, 11.266262, Alt Bärnbad (Gasthaus) - 6#FF014E9A - 47.114715,11.266262 - 47.114135,11.268381 - 47.113421,11.269322 - 47.11277,11.269979 - 47.112408,11.271119 - - ''' - attributes, coords, paths = wrpylib.mwmarkup.parse_googlemap(wikitext) - json = wrpylib.wrmwmarkup.googlemap_to_wrmap(attributes, coords, paths) - assert json['properties']['lon'] == 11.272337 - assert json['properties']['lat'] == 47.113291 - assert json['properties']['zoom'] == 15 - assert json['properties']['height'] == 450 - assert json['features'][0]['properties']['type'] == 'parkplatz' - assert json['features'][0]['properties']['name'] == 'Erster Parkplatz' - assert json['features'][0]['geometry']['coordinates'] == [11.266026, 47.114958] - assert json['features'][1]['properties']['type'] == 'gasthaus' - assert json['features'][1]['properties']['name'] == 'Alt Bärnbad (Gasthaus)' - assert json['features'][1]['geometry']['coordinates'] == [11.266262, 47.114715] - assert json['features'][2]['properties']['type'] == 'rodelbahn' - assert json['features'][2]['geometry']['coordinates'] == [ - [11.266262, 47.114715], - [11.268381, 47.114135], - [11.269322, 47.113421], - [11.269979, 47.11277], - [11.271119, 47.112408]] - +class TestWrMap(unittest.TestCase): def test_parse_wrmap(self): wikitext = ''' -- 2.39.5