0

I wrote the following code for testing my class but the "Ran 0 tests in 0.000" Error occured:

import unittest

from survey import AnonymousSurvey

class TestAnonymousSurvey(unittest.TestCase):

      def test_store_single_response(self):

         question="Which language did you first learn to speak?"

         my_survey=AnonymousSurvey(question)

         my_survey.store_response('English')

         self.assertIn('English',my_survey.responses)

if __name__=='__main__':

  unittest.main()
vida
  • 31
  • 4

1 Answers1

0

I think you have to give an input for the question, the AnonymousSurvery(question) initializes the survey:

     getResponse = input("Which language did you first learn to speak?")
     latestResponse = my_survery.store_response(getResponse)  

     self.assertIn("English", latestResponse)

Continue on with the main function below...

de_classified
  • 1,927
  • 1
  • 15
  • 19