Ejemplo n.º 1
0
    def testAssignmentisValid(self):
        assi = Assignment("234" , "" , "4" , "6")
        assert assi.isValid() == False

        assi = Assignment("234" , "this blows" , "4" , "")
        assert assi.isValid() == False

        assi = Assignment("" , "this blows" , "4" , "6")
        assert assi.isValid() == False

        assi = Assignment("234" , "this blows" , "" , "")
        assert len(assi.getErrors()) == 2

        assi = Assignment("" , "" , "4" , "")
        assert len(assi.getErrors()) == 3
Ejemplo n.º 2
0
 def testCreateAssignment(self):
     assi = Assignment("234" , "this blows" , "4" , "6")
     assert assi.getId() == "234"
     assert assi.getDeadline() == "4"
     assert assi.getDesc() == "this blows"
     assert assi.getGrade() == "6"
Ejemplo n.º 3
0
 def testGetErrors(self):
     asg = Assignment('', '', '', 5)
     assert asg.getErrors() != []
     assert len(asg.getErrors()) == 3
     asg = Assignment('5', 'do it', '6', 7)
     assert not(asg.getErrors() != [])
Ejemplo n.º 4
0
 def testAssignment(self):
     asg = Assignment('2', 'lab', '6', 5)
     assert asg.getDesc() == 'lab'
     assert not(asg.getId() == '52')
Ejemplo n.º 5
0
 def testIsValid(self):
     asg = Assignment('', '' , '4', 5)
     assert asg.isValid() == False
     assert asg.getDeadline() != ''