Commits

Miguel Ángel García committed 10db320

Green. Mark II corrected. I have the third question

Comments (0)

Files changed (3)

         '''
         Constructor
         '''
-        self.wheelMove = - ( wheelmove + wheel2move + 1 )
+        self.wheelMove = wheelmove  - (2 * wheel2move)  
         
     def decode (self, input):
         result = ""
         result = mark.decode (input)
         self.assertEquals (expected, result)
 
+    def testSetting93GetWindString (self):
+        mark = MarkII(9,3)
+        input = 'The Desert Fox will move 30 tanks to Calais at dawn'
+        expected = 'Wkh2Ghvhuw2Ir.2zloo2pryh2632wdqnv2wr2Fdodlv2dw2gdzq'
+        result = mark.decode(input)
+        self.assertEquals (expected, result)
+
 if __name__ == "__main__":
     #import sys;sys.argv = ['', 'Test.testName']
     unittest.main()

src/MinisculusTest.py

 class MinisculusTest(unittest.TestCase):
     FIRST_QUESTION_LOCATION = '/14f7ca5f6ff1a5afb9032aa5e533ad95'
     SECOND_QUESTION_LOCATION = '/2077f244def8a70e5ea758bd8352fcd8'
+    THIRD_QUESTION_LOCATION = '/36d80eb0c50b49a509b49f2424e8c805'
     
     FIRST_SENTENCE = 'Strong NE Winds!'
     SECOND_SENTENCE = 'The Desert Fox will move 30 tanks to Calais at dawn'
         self.assertEquals ( 200, response[0] )
         self.assertEquals ( MinisculusTest.SECOND_SENTENCE, response[2]['question'])
         
+    def testSendSecondAnswerCorrect (self):
+        mark = MarkII(9,3)
+        answer = mark.decode(MinisculusTest.SECOND_SENTENCE)
+        response = self.minisculus.sendAnswer (answer, MinisculusTest.SECOND_QUESTION_LOCATION)
+        self.assertEquals ( 303, response[0] )
+        print response
+        self.assertEquals ( MinisculusTest.THIRD_QUESTION_LOCATION, response[1]['location'] )
         
 if __name__ == "__main__":
     #import sys;sys.argv = ['', 'Test.testName']