Пример #1
0
    def test_meta_contains_updates_file_timestamp(self):
        content = factory.make_string()
        storage, meta_file = self.make_meta_file(content)

        # Change the file's timestamp to a week ago.
        one_week_ago = timedelta(weeks=1).total_seconds()
        age_file(meta_file, one_week_ago)

        boot_resources.meta_contains(storage, content)

        # Check the timestamp was updated.
        expected_date = datetime.now()
        actual_date = datetime.fromtimestamp(int(os.path.getmtime(meta_file)))
        self.assertEqual(expected_date.day, actual_date.day)
Пример #2
0
 def test_mismatching_content_is_compared_False(self):
     content = factory.make_string()
     storage, meta_file = self.make_meta_file()
     self.assertFalse(boot_resources.meta_contains(storage, content))