2016-06-28 11 views
0

Im Ausführen des Selbsttests und dabei bekomme ich mehrere Fehler mit der Instanznachricht: "Globaler Name 'Parser' ist nicht definiert"Selbsttest scheitert mit Python-Fehler 'Globaler Name' Parser 'ist nicht definiert'

Ich habe alle Pakete für Python installiert (mit der Version 2.7 unter Ubuntu) und es ist nur die Tests für den UpdateTestContent Teil der Suite, die fehlschlägt.

Hat jemand irgendwelche Vorschläge, wie man diesen Fehler beheben kann?

Ein Beispiel für die Ausgabe lautet: (aber im genau diesen gleichen Fehler etwa 30-mal auf den UpdateTestContent Tests)

Gestoppt UpdateTestContent test_combinatorial_get_test_content_173616823212099076936397683973588533375 (mediaCollection) {id = "top" itemType = "Container" Displaytype = "list" title = "HitsNL TOP30" canPlay = True canEnumerate = True albumArtURI = "https://external.unplug.de/img/hitsnl_top_30.png"}

Instanz Nachrichten:
global name 'parser' is not defined

2016.06.27 16: 42: 08.503 [INFO] SONOS.sonos.workflow.fixture.UpdateTestContent - Testfall: 1 UpdateTestContent test_combinatorial_get_test_content_173616823212099076936397683973588533375

(mediaCollection){ 
    id = "top" 
    itemType = "container" 
    displayType = "list" 
    title = "HitsNL top30" 
    canPlay = True 
    canEnumerate = True 
    albumArtURI = "https://external.unplug.de/img/hitsnl_top_30.png" 
}) 

2016-06-27 16:42 : 08,503 [PASS] SONOS.sonos.workflow.fixture.UpdateTestContent - Kein Testinhalt muss aktualisiert werden. (Ausdruck ist wahr)

2016-06-27 16: 42: 08.503 [STOP] SONOS.sonos.workflow.fixture.UpdateTestContent - global name 'Parser' definiert ist, nicht

2016-06-27 16 : 42: 08.503 [STOP] SONOS.sonos.workflow.fixture.UpdateTestContent - 1 UpdateTestContent test_combinatorial_get_test_content_173616823212099076936397683973588533375

2016-06-27 16: 42: 08.504 [DEBUG] SONOS.sonos.workflow.fixture.UpdateTestContent - [(‘ ../../sonos-1.1.0.dev_r248336-py2.7.egg/sonos/workflow/fixture.py ', 2483,' _run_test_iteration ',' testMethod (factoryTestValues) '), ('/home/zazell/Anwendungen/sonos/smapi/content_workflow/updatetestcontent.py ', 90,' test_combinatorial_ge t_test_content ',' self.smapiservice. init (self.smapiservice.configfile, parser.wsdl, CRAWLER_DISABLE) ')]

2016.06.27 16: 42: 08.504 [INFO] SONOS.sonos.workflow.fixture.UpdateTestContent - - - - - - - - - - - - - - - - - - - - - - - - -

2016-06-27 16: 42: 08,505 [INFO] SONOS.sonos.workflow.result - Ende Test Iteration 0 von Testfall test_combinatorial_get_test_content am Monday, 27. Juni 2016 16.42

Antwort

0

ich es endlich geschafft, durch dieses Problem zu beheben Hinzufügen global parser parser = ServiceConfigOptionParser(sys.argv) an die init Methode der UpdateTestContent-Klasse, die es ordnungsgemäß ausgeführt wird.