Exemple #1
0
    def test9(self):
        self.skipOrRunTest('test9')
        print(
            ">>>>>>>>>>>>>>>Scale 1 lakh add, delete, delay, create test<<<<<<<<<<<<<<<<<"
        )
        a_list = [s for s in sequence_generator(100001)]
        for s in a_list:
            a = work.create_id(s)
        work.dumpIdDB()
        #work.dumpDataDB()
        for i in range(100001):
            work.delete_id(i)

        work.dumpIdDB()
        work.dumpDataDB()
        #work.hDump()

        time.sleep(2)
        a_list = [s for s in sequence_generator(1000)]
        for s in a_list:
            a = work.create_id(s)
        work.dumpIdDB()
        work.hDump()
        print(">>>>>>>>>>>>>>>>>>>>>>>>test 9 ok<<<<<<<<<<<<<<<<<<<<<<<<")
        print(" ")
Exemple #2
0
 def test6(self):
     self.skipOrRunTest('test6')
     #Now we have 3 4 and 5. create a new one. 2 should should come back. Not 1
     print(
         ">>>>>>>>>>>>>>Reference delete test<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
     )
     tr = 'clap'
     aa = work.create_id(tr)
     self.assertEqual(aa, 2)
     work.dumpIdDB()
     work.hDump()
     print(">>>>>>>>>>>>>>>>>>>>>>>>test 6 ok<<<<<<<<<<<<<<<<<<<<<<<<")
     print(" ")
Exemple #3
0
    def test7(self):
        self.skipOrRunTest('test7')
        print(
            ">>>>>>>>>>>>>>>>>>>>>>>>Frequent add delete test<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
        )

        strs = ["c0b", "c1b", "c2b"]
        dict = {}
        for str in strs:
            a = work.create_id(str)
            dict[a] = str

        b = work.query_id(6)
        phr = ctypes.c_char_p.from_buffer(b)

        work.dumpIdDB()
        work.dumpDataDB()

        work.delete_id(1)
        work.delete_id(2)
        work.delete_id(3)
        work.dumpIdDB()
        work.dumpDataDB()
        work.hDump()

        strs = ["q1", "q2", "q3"]
        dict = {}
        for str in strs:
            a = work.create_id(str)
            dict[a] = str

        b = work.query_id(6)
        phr = ctypes.c_char_p.from_buffer(b)

        work.dumpIdDB()
        work.dumpDataDB()

        work.delete_id(4)
        work.delete_id(5)
        work.delete_id(6)
        work.dumpIdDB()
        work.dumpDataDB()
        work.hDump()

        print(">>>>>>>>>>>>>>>>>>>>>>>>test 8 ok<<<<<<<<<<<<<<<<<<<<<<<<")
        print(" ")
Exemple #4
0
    def test11(self):
        self.skipOrRunTest('test11')
        print(">>>>>>>>>>>>Storing a paragraph<<<<<<<<<<<<<<<<<")

        s = """The sky is blue. 
             The rainbow is multicolored.
             Wonder why?"""
        a = work.create_id(s)

        work.dumpIdDB()
        work.dumpDataDB()
        work.hDump()

        b = work.query_id(2)
        #phr = ctypes.c_char_p.from_buffer(b)
        #print(b)

        print(">>>>>>>>>>>>>>>>>>>>>>>>test 11 ok<<<<<<<<<<<<<<<<<<<<<<<<")
        print(" ")
Exemple #5
0
    def test4(self):
        self.skipOrRunTest('test4')
        #With 1 and 2 alreay deleted, sleep for 5 seconds, next create should give id 1
        print(
            ">>>>>>>>>>>>>>Delete 2 as well, sleep, create to see if 1 is alloted<<<<"
        )
        work.delete_id(2)
        self.assertEqual(2, 2)

        b = work.query_id(2)
        phr = ctypes.c_char_p.from_buffer(b)
        self.assertEqual(phr.value, "Not Exists")
        work.dumpIdDB()
        work.hDump()
        #As of now, 1 and 2 are delete. 3 4 and 5 are there
        time.sleep(5)
        Str = 'welcome'
        aa = work.create_id(Str)
        self.assertEqual(aa, 1)
        work.dumpIdDB()
        work.hDump()
        print(">>>>>>>>>>>>>>>>>>>>>>>>test 4 ok<<<<<<<<<<<<<<<<<<<<<<<<")
        print(" ")
Exemple #6
0
    def test10(self):
        self.skipOrRunTest('test10')
        print(
            ">>>>>>>>>>>>>>>Reference test create thrice. Delete thrice<<<<<<<<<<<<<<<<<"
        )
        a_list = [s for s in sequence_generator(11)]
        for s in a_list:
            a = work.create_id(s)

        for s in a_list:
            a = work.create_id(s)

        for s in a_list:
            a = work.create_id(s)

        work.dumpIdDB()
        #work.dumpDataDB()
        for i in range(12):
            work.delete_id(i)
        work.dumpIdDB()
        work.hDump()
        work.dumpDataDB()
        for i in range(12):
            work.delete_id(i)
        work.dumpIdDB()
        work.hDump()
        work.dumpDataDB()

        for i in range(12):
            work.delete_id(i)

        work.dumpIdDB()
        work.dumpDataDB()
        work.hDump()

        #work.dumpIdDB()
        #work.hDump()
        print(">>>>>>>>>>>>>>>>>>>>>>>>test 10 ok<<<<<<<<<<<<<<<<<<<<<<<<")
        print(" ")