Ejemplo n.º 1
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)
Ejemplo n.º 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
Ejemplo n.º 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
    +++++++
Ejemplo n.º 4
0
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
    +++++++