def _worker_Xrandom(self, rfunc):
styles = ["8beat", "ballad", "rock"]
s = """
styles = %s
question {
style = %s("8beat", "ballad")
}
question {
style = %s(styles)
}
""" % (", ".join(['"%s"' % x for x in styles]), rfunc, rfunc)
self.p = QuestionsLessonfile()
p = self.do_file(s)
for idx in range(2):
st = p.m_questions[idx]['style']
for x in range(20):
self.assert_(str(st) in styles)
self.assert_(unicode(st) in styles)
st.randomize()
# This test only works with nrandom, because prandom will
# return a possible different value every time.
if rfunc == 'nrandom':
l = Gtk.Label(label=st)
self.assert_(l.get_text() == unicode(st), "%s and gtk does not cooperate." % rfunc)
评论列表
文章目录