Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/core/tests/test_compatibility.py
- This file was added.
# Copyright (C) 2018 The Software Heritage developers | |||||
# See the AUTHORS file at the top-level directory of this distribution | |||||
# License: GNU General Public License version 3, or any later version | |||||
# See top-level LICENSE file for more information | |||||
from unittest import TestCase | |||||
import warnings | |||||
from . import BaseLoaderStorageTest | |||||
from swh.storage.in_memory import Storage | |||||
class DeprecatedAliasesTest(BaseLoaderStorageTest, TestCase): | |||||
def test_deprecated_aliases(self): | |||||
self.storage = Storage() | |||||
with warnings.catch_warnings(record=True) as w: | |||||
self.assertContentsOk([]) | |||||
self.assertEqual(len(w), 1, w) | |||||
self.assertTrue(issubclass(w[0].category, DeprecationWarning)) | |||||
self.assertIn('use assertContentsContain instead', | |||||
str(w[0].message)) |