a oe @s^ddlZddlZddlZddlZddlZGdddejZGdddeZedkrZe dS)Nc@s,eZdZddZddZddZddZd S) TestParsercCs(tjtjtdd}t||_dS)N win32rcparsertest.rc)ospathjoindirname__file__rZParse resources)selfrc_filer >C:\Program Files\Certbot\pkgs\win32\test\test_win32rcparser.pysetUp szTestParser.setUpcCs,dD]"\}}|jj|j}|||qdS)N))ZIDS_TEST_STRING4zTest 'single quoted' string)ZIDS_TEST_STRING1zTest "quoted" string)ZIDS_TEST_STRING3zString with single " quote)ZIDS_TEST_STRING2z Test string)r Z stringTablevalue assertEqual)r ZsidZexpectedZgotr r r testStringss zTestParser.testStringscCsDdD]6}tt|}||jj||||jj||qdS)Nz IDOK IDCANCEL)splitgetattrwin32conrr namesids)r ZidcZcorrectr r rtestStandardIdss  zTestParser.testStandardIdsc sjjd}ddg}fdd|D}dg}fdd|D}d}|d dD]d}|d }|d } |d } ||vr| tj@tj|d 7}qN||vrN| tj@d|d 7}qN|t|t|dS) NZIDD_TEST_DIALOG2Z IDC_EDIT1ZIDOKcsg|]}jj|qSr r r.0namer r r !z*TestParser.testTabStop..Z IDC_EDIT2csg|]}jj|qSr rrrr rr#rr)r ZdialogsrrZ WS_TABSTOPlen) r dZ tabstop_namesZ tabstop_idsZnotabstop_namesZ notabstop_idsZnum_okZcdefZcidZstyleZstyleexr rr testTabStops"   zTestParser.testTabStopN)__name__ __module__ __qualname__rrrr&r r r rr s rc@seZdZddZdS) TestGeneratedc Cstjtjtdd}td}z2t||t | }Wtj |rnt |ntj |rlt |0i}t ||||d|_dS)Nrrztest_win32rcparser.pyZ FakeParser)rrrrr tempfileZmktemprZGenerateFrozenResourceopenreadisfileunlinkexecr )r r Zpy_fileZ py_sourceZglobsr r rr4s      zTestGenerated.setUpN)r'r(r)rr r r rr*3sr*__main__) rr+ZunittestrrZTestCaserr*r'mainr r r rs*