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