Skip to content
Snippets Groups Projects
report1.py 655 B
Newer Older
  • Learn to ignore specific revisions
  • tuhe's avatar
    tuhe committed
    import unittest #!s=all
    
    from unitgrade import Report, evaluate_report_student
    
    tuhe's avatar
    tuhe committed
    import cs101
    
    tuhe's avatar
    tuhe committed
    from cs101.homework1 import reverse_list, add #!s
    
    tuhe's avatar
    tuhe committed
    
    class Week1(unittest.TestCase):
        def test_add(self):
            self.assertEqual(add(2,2), 4)
            self.assertEqual(add(-100, 5), -95)
    
        def test_reverse(self):
    
    tuhe's avatar
    tuhe committed
            self.assertEqual(reverse_list([1,2,3]), [3,2,1]) #!s
    
    tuhe's avatar
    tuhe committed
    
    class Report1(Report):
        title = "CS 101 Report 1"
    
    tuhe's avatar
    tuhe committed
        questions = [(Week1, 10)]  # Include a single question for a total of 10 credits.
        pack_imports = [cs101]     # Include all .py files in this folder
    
    tuhe's avatar
    tuhe committed
    
    if __name__ == "__main__":
    
    tuhe's avatar
    tuhe committed
        evaluate_report_student(Report1()) #!s=all