コード例 #1
0
ファイル: test.py プロジェクト: bharathi26/pycopia
 def test_mapstr(self):
     TEST = aid.mapstr("some%(one)s one\nsome%(two)s three\nsome%(three)s four")
     print(TEST.attributes)
     try:
         print(TEST)
     except ValueError:
         print("got correct error from %r" % TEST)
     TEST.one = "one"
     TEST.two = "thing"
     TEST.three = "where"
     print(TEST)
     s = str(TEST) # makes new, substituted, string
     assert s == "someone one\nsomething three\nsomewhere four"
     print(TEST.three)
コード例 #2
0
 def test_mapstr(self):
     TEST = aid.mapstr("some%(one)s one\nsome%(two)s three\nsome%(three)s four")
     print TEST.attributes()
     try:
         print TEST
     except ValueError:
         print "got correct error from %r" % TEST
     TEST.one = "one"
     TEST.two = "thing"
     TEST.three = "where"
     print TEST
     s = str(TEST) # makes new, substituted, string
     assert s == "someone one\nsomething three\nsomewhere four"
     print TEST.three
コード例 #3
0
from sqlalchemy import and_, or_

from pycopia import textutils
from pycopia.db import models
from pycopia.aid import mapstr

### Test case template file parts follow.

HEAD = mapstr("""#!/usr/bin/python
# vim:ts=4:sw=4:softtabstop=0:smarttab

\"\"\"
%(heading)s
%(line)s

%(modinfo)s

\"\"\"

from pycopia.QA import core
""")

MODIMPORT = mapstr("""from %(modname)s import %(classname)s
""")

CLASSDEF = mapstr("""
class %(classname)s(core.Test):
    \"\"\"
    Purpose
    +++++++
コード例 #4
0
ファイル: tests.py プロジェクト: bharathi26/pycopia
from pycopia import textutils
from pycopia.db import models
from pycopia.aid import mapstr



### Test case template file parts follow.

HEAD = mapstr("""#!/usr/bin/python
# vim:ts=4:sw=4:softtabstop=0:smarttab

\"\"\"
%(heading)s
%(line)s

%(modinfo)s

\"\"\"

from pycopia.QA import core
""")

MODIMPORT = mapstr("""from %(modname)s import %(classname)s
""")

CLASSDEF = mapstr("""
class %(classname)s(core.Test):
    \"\"\"
    Purpose
    +++++++