Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/core/tests/test_loader.py
Show First 20 Lines • Show All 116 Lines • ▼ Show 20 Lines | |||||
class LoadTestContent(DummyBaseLoaderTest): | class LoadTestContent(DummyBaseLoaderTest): | ||||
def test_load_contents(self): | def test_load_contents(self): | ||||
"""Loading contents should be ok | """Loading contents should be ok | ||||
""" | """ | ||||
self.storage.content_add(self.in_contents) | self.storage.content_add(self.in_contents) | ||||
self.assertCountContents(len(self.expected_contents)) | self.assertCountContents(len(self.expected_contents)) | ||||
self.assertContentsOk(self.expected_contents) | self.assertContentsContain(self.expected_contents) | ||||
def test_failing(self): | def test_failing(self): | ||||
"""Comparing wrong snapshot should fail. | """Comparing wrong snapshot should fail. | ||||
""" | """ | ||||
self.storage.content_add(self.in_contents) | self.storage.content_add(self.in_contents) | ||||
with self.assertRaises(AssertionError): | with self.assertRaises(AssertionError): | ||||
self.assertContentsOk([]) | self.assertContentsContain([]) | ||||
class LoadTestDirectory(DummyBaseLoaderTest): | class LoadTestDirectory(DummyBaseLoaderTest): | ||||
def test_send_batch_directories(self): | def test_send_batch_directories(self): | ||||
"""Loading directories should be ok | """Loading directories should be ok | ||||
""" | """ | ||||
self.storage.directory_add(self.in_directories) | self.storage.directory_add(self.in_directories) | ||||
self.assertCountDirectories(len(self.in_directories)) | self.assertCountDirectories(len(self.in_directories)) | ||||
self.assertDirectoriesOk(self.in_directories) | self.assertDirectoriesContain(self.in_directories) | ||||
def test_failing(self): | def test_failing(self): | ||||
"""Comparing wrong snapshot should fail. | """Comparing wrong snapshot should fail. | ||||
""" | """ | ||||
self.storage.directory_add(self.in_directories) | self.storage.directory_add(self.in_directories) | ||||
with self.assertRaises(AssertionError): | with self.assertRaises(AssertionError): | ||||
self.assertDirectoriesOk([]) | self.assertDirectoriesContain([]) |