示例#1
0
 def test_empty_create_fc(self):
     sub = None
     que = None
     ans = None
     dbRoutine.create_fc(sub, que, ans);
     
     subjects = dbRoutine.retrieve_allSub();
     
     self.assertEqual(0, subjects.count());
     
     
     sub = None
     que = "question"
     ans = "answer"
     dbRoutine.create_fc(sub, que, ans);
     
     subjects = dbRoutine.retrieve_allSub();
     
     self.assertEqual(0, subjects.count());
     
     
     sub = "math"
     que = None
     ans = None
     dbRoutine.create_fc(sub, que, ans);
     
     subjects = dbRoutine.retrieve_allSub();
     
     self.assertEqual(0, subjects.count());
示例#2
0
 def test_delete_subject(self):
     sub1 = "math"
     sub2 = "english"
     que = "question"
     ans = "answer"
     
     dbRoutine.create_fc(sub1, que, ans);
     dbRoutine.create_fc(sub2, que, ans);
     
     #dbRoutine.delete_sub("math")
     
     subjects = dbRoutine.retrieve_allSub();
示例#3
0
 def test_retrieve_subjects(self):
     sub1 = "math"
     sub2 = "english"
     sub3 = "physics"
     que = "question"
     ans = "answer"
     
     dbRoutine.create_fc(sub1, que, ans);
     dbRoutine.create_fc(sub2, que, ans);
     dbRoutine.create_fc(sub3, que, ans);
     
     subjects = dbRoutine.retrieve_allSub();
     
     self.assertEqual(3, subjects.count());
示例#4
0
    def test_create_multiple_flashcards(self):

        sub = "Test Subject"
        que = "Test Question"
        ans = "Test Answer"
        dbRoutine.create_fc(sub, que, ans)

        sub = "Test Subject2"
        dbRoutine.create_fc(sub, que, ans)

        sub = "Test Subject3"
        dbRoutine.create_fc(sub, que, ans)

        subjects = dbRoutine.retrieve_allSub()

        self.assertEqual(3, subjects.count())