Пример #1
0
class Example (QtGui.QWidget):

    def __init__(self, parent):
        super(Example, self).__init__(parent)
        self.mOnverterCay = OnverterCay()
        self.initUI()
        
    def initUI(self):
        
        self.xtTay = QtGui.QLineEdit()
        okButton = QtGui.QPushButton("Onvertcay")
        self.lbl = QtGui.QLabel('test')
        
        okButton.clicked.connect(self.onvertcayText)

        vbox = QtGui.QVBoxLayout()
        
        vbox.addWidget(self.xtTay)
        vbox.addWidget(self.lbl)
        vbox.addWidget(okButton)
        
        self.setLayout(vbox)    
        
        #self.setGeometry(10, 10, 300, 150)
        #self.setWindowTitle('Pig Latinizer')    
        #self.show()
        
    def onvertcayText(self):
        onvertedcayResult = self.mOnverterCay.onvertCay(self.xtTay.text())
        self.lbl.setText(onvertedcayResult)
Пример #2
0
class TestOverterCay(unittest.TestCase):
	def setUp(self):
		self.onverterCay = OnverterCay()
		self.testWord = 'test'
		self.expectedResult = 'est-tay'
	
	def test_onvertCaying(self):
		result = self.onverterCay.onvertCay(self.testWord)
		self.assertEqual(self.expectedResult, result, 'oh this ain\'t right...')
Пример #3
0
 def __init__(self, parent):
     super(Example, self).__init__(parent)
     self.mOnverterCay = OnverterCay()
     self.initUI()
Пример #4
0
	def setUp(self):
		self.onverterCay = OnverterCay()
		self.testWord = 'test'
		self.expectedResult = 'est-tay'