Esempio n. 1
0
 def test_log_updates(self):
     # get last updated time
     with open(charitycheck._update_log, "r") as log:
         log.seek(-26, 2)
         date_string = log.read()
         last_updated = datetime.datetime(
             # convert/unpack date_string into
             # the proper format.
             *(
                 map(
                     int,
                     [
                         date_string[0:4],
                         date_string[5:7],
                         date_string[8:10],
                         date_string[11:13],
                         date_string[14:16],
                         date_string[17:19],
                         date_string[20:],
                     ],
                 )
             )
         )
     # run make dbm
     charitycheck.make_dbm()
     # get new updated time
     with open(charitycheck._update_log, "r") as log:
         log.seek(-26, 2)
         date_string = log.read()
         new_last_updated = datetime.datetime(
             # convert/unpack date_string into
             # the proper format.
             *(
                 map(
                     int,
                     [
                         date_string[0:4],
                         date_string[5:7],
                         date_string[8:10],
                         date_string[11:13],
                         date_string[14:16],
                         date_string[17:19],
                         date_string[20:],
                     ],
                 )
             )
         )
     self.assertNotEqual(last_updated, new_last_updated)
Esempio n. 2
0
 def test_make_dbm(self):
     charitycheck.make_dbm()  # catch any possible errors/exceptions
     self.assertTrue(True)