<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> __date__ = '<STR_LIT>' <EOL> __copyright__ = '<STR_LIT>' <EOL> import unittest <EOL> from PyQt4 . QtGui import QDialogButtonBox , QDialog <EOL> from open_data_austria_dialog import OpenDataAustriaDialog <EOL> from utilities import get_qgis_app <EOL> QGIS_APP = get_qgis_app ( ) <EOL> class OpenDataAustriaDialogTest ( unittest . TestCase ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> """<STR_LIT>""" <EOL> self . dialog = OpenDataAustriaDialog ( None ) <EOL> def tearDown ( self ) : <EOL> """<STR_LIT>""" <EOL> self . dialog = None <EOL> def test_dialog_ok ( self ) : <EOL> """<STR_LIT>""" <EOL> button = self . dialog . button_box . button ( QDialogButtonBox . Ok ) <EOL> button . click ( ) <EOL> result = self . dialog . result ( ) <EOL> self . assertEqual ( result , QDialog . Accepted ) <EOL> def test_dialog_cancel ( self ) : <EOL> """<STR_LIT>""" <EOL> button = self . dialog . button_box . button ( QDialogButtonBox . Cancel ) <EOL> button . click ( ) <EOL> result = self . dialog . result ( ) <EOL> self . assertEqual ( result , QDialog . Rejected ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> suite = unittest . makeSuite ( OpenDataAustriaDialogTest ) <EOL> runner = unittest . TextTestRunner ( verbosity = <NUM_LIT:2> ) <EOL> runner . run ( suite ) </s>
