def test_parser_older_than_to_datetime(self): apt_btrfs = AptBtrfsSnapshot( fstab=os.path.join(self.testdir, "data", "fstab"), sandbox=self.sandbox) t = apt_btrfs._parse_older_than_to_datetime("5d") e = datetime.datetime.now() - datetime.timedelta(5) # Check that t is within a second of e self.assertTrue(e - t < datetime.timedelta(0, 1))
def test_parser_older_than_to_datetime(self): apt_btrfs = AptBtrfsSnapshot( fstab=os.path.join(self.testdir, "data", "fstab")) t = apt_btrfs._parse_older_than_to_datetime("5d") self.assertTrue(t <= datetime.datetime.now() - datetime.timedelta(5))