コード例 #1
0
    def test_course_registration_fail(self):
        fixtures.correct_instantiation(self.st)
        students = list(self.db._tables["student"].values())

        ret2 = students[1].course_registration(self.db, 2, [0, 2])

        self.db.clear()
        self.assertFalse(ret2)
コード例 #2
0
    def test_course_registration_pass(self):
        fixtures.correct_instantiation(self.st)
        students = list(self.db._tables["student"].values())

        ret1 = students[0].course_registration(self.db, 2, [0, 1])

        self.db.clear()
        self.assertTrue(ret1)
コード例 #3
0
    def test_student_registration_pass(self):
        fixtures.correct_instantiation(self.st)
        depts = list(self.db._tables["department"].values())
        students = list(self.db._tables["student"].values())

        ret1 = students[0].register(self.db, 2, "DU14012341")
        # ret2 = students[1].register(self.db, 2, "")

        self.assertTrue(ret1)
コード例 #4
0
    def test_correct_instantiation(self):
        fixtures.correct_instantiation(self.st)

        valid = True
        for name in self.table_names:
            if len(self.db._tables[name]) != self.table_sizes[name]:
                valid = False
                break

        self.db.clear()
        self.assertTrue(valid)
コード例 #5
0
 def setUp(self):
     fixtures.correct_instantiation(self.st, "notimings")
コード例 #6
0
 def setUp(self):
     fixtures.correct_instantiation(self.st)