def test_003(self, capfd):
        sys.stdin = StringIO(u'-1\n1\n')
        problems = submit.part_prompt(self.metadata.part_data)
        assert(len(problems) == 1)

        resout, reserr = capfd.readouterr()
        assert('It is out of the valid range' in resout)
    def test_001(self, capfd):
        sys.stdin = StringIO(u'0.1\n1\n')
        problems = submit.part_prompt(self.metadata.part_data)
        assert(len(problems) == 1)

        resout, reserr = capfd.readouterr()
        assert('It is not an integer.' in resout)
    def test_003(self, capfd):
        sys.stdin = StringIO(u'-1\n1\n')
        problems = submit.part_prompt(self.metadata.part_data)
        assert (len(problems) == 1)

        resout, reserr = capfd.readouterr()
        assert ('It is out of the valid range' in resout)
    def test_001(self, capfd):
        sys.stdin = StringIO(u'0.1\n1\n')
        problems = submit.part_prompt(self.metadata.part_data)
        assert (len(problems) == 1)

        resout, reserr = capfd.readouterr()
        assert ('It is not an integer.' in resout)
 def test_005(self, capfd):
     sys.stdin = StringIO(u'0\n')
     problems = submit.part_prompt(self.metadata.part_data)
     assert(len(problems) == len(self.metadata.part_data))
 def test_005(self, capfd):
     sys.stdin = StringIO(u'0\n')
     problems = submit.part_prompt(self.metadata.part_data)
     assert (len(problems) == len(self.metadata.part_data))
 def test_004(self, capfd):
     sys.stdin = StringIO(u'1,2\n')
     problems, models = submit.part_prompt(self.metadata.problem_data,
                                           self.metadata.model_data)
     assert (len(problems) == 2)