diff --git a/swh/loader/core/tests/test_converters.py b/swh/loader/core/tests/test_converters.py --- a/swh/loader/core/tests/test_converters.py +++ b/swh/loader/core/tests/test_converters.py @@ -8,10 +8,8 @@ import unittest from unittest.mock import Mock -from nose.tools import istest - -from swh.model.from_disk import Content from swh.loader.core import converters +from swh.model.from_disk import Content def tmpfile_with_content(fromdir, contentfile): @@ -41,8 +39,7 @@ def tearDown(self): self.tmpdir.cleanup() - @istest - def content_for_storage_path(self): + def test_content_for_storage_path(self): # given data = b'temp file for testing content storage conversion' tmpfile = tmpfile_with_content(self.tmpdir.name, data) @@ -60,8 +57,7 @@ # then self.assertEqual(content, expected_content) - @istest - def content_for_storage_data(self): + def test_content_for_storage_data(self): # given data = b'temp file for testing content storage conversion' @@ -76,8 +72,7 @@ # then self.assertEqual(content, expected_content) - @istest - def content_for_storage_too_long(self): + def test_content_for_storage_too_long(self): # given data = b'temp file for testing content storage conversion' diff --git a/swh/loader/core/tests/test_loader.py b/swh/loader/core/tests/test_loader.py --- a/swh/loader/core/tests/test_loader.py +++ b/swh/loader/core/tests/test_loader.py @@ -3,12 +3,11 @@ # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information -from nose.tools import istest - -from . import BaseLoaderTest, LoaderNoStorage from swh.model.hashutil import hash_to_bytes +from . import BaseLoaderTest, LoaderNoStorage + class DummyBaseLoaderTest(BaseLoaderTest): def setUp(self): @@ -29,8 +28,7 @@ super().setUp() self.loader = LoaderNoStorage() - @istest - def stateful_loader(self): + def test_stateful_loader(self): """Stateful loader accumulates in place the sent data Note: Those behaviors should be somehow merged but that's @@ -50,8 +48,7 @@ len(self.state('release')), len(self.in_releases)) self.assertEquals(len(self.state('snapshot')), 0) - @istest - def stateless_loader(self): + def test_stateless_loader(self): """Stateless loader accumulates in place the sent data as well Note: Those behaviors should be somehow merged but that's @@ -83,8 +80,7 @@ }] self.expected_contents = [self.content_id0, self.content_id1] - @istest - def maybe_load_contents(self): + def test_maybe_load_contents(self): """Loading contents should be ok """ @@ -92,8 +88,7 @@ self.assertCountContents(len(self.expected_contents)) self.assertContentsOk(self.expected_contents) - @istest - def send_batch_contents(self): + def test_send_batch_contents(self): """Sending contents should be ok 2 """ @@ -101,8 +96,7 @@ self.assertCountContents(len(self.expected_contents)) self.assertContentsOk(self.expected_contents) - @istest - def failing(self): + def test_failing(self): """Comparing wrong snapshot should fail. """ @@ -130,8 +124,7 @@ self.expected_directories = [ self.directory_id0, self.directory_id1, self.directory_id2] - @istest - def maybe_load_directories(self): + def test_maybe_load_directories(self): """Loading directories should be ok """ @@ -139,8 +132,7 @@ self.assertCountDirectories(len(self.expected_directories)) self.assertDirectoriesOk(self.expected_directories) - @istest - def send_batch_directories(self): + def test_send_batch_directories(self): """Sending directories should be ok 2 """ @@ -148,8 +140,7 @@ self.assertCountDirectories(len(self.expected_directories)) self.assertDirectoriesOk(self.expected_directories) - @istest - def failing(self): + def test_failing(self): """Comparing wrong snapshot should fail. """ @@ -177,8 +168,7 @@ self.expected_releases = [ self.release_id0, self.release_id1, self.release_id2] - @istest - def maybe_load_releases(self): + def test_maybe_load_releases(self): """Loading releases should be ok """ @@ -186,8 +176,7 @@ self.assertCountReleases(len(self.expected_releases)) self.assertReleasesOk(self.expected_releases) - @istest - def send_batch_releases(self): + def test_send_batch_releases(self): """Sending releases should be ok 2 """ @@ -195,8 +184,7 @@ self.assertCountReleases(len(self.expected_releases)) self.assertReleasesOk(self.expected_releases) - @istest - def failing(self): + def test_failing(self): """Comparing wrong snapshot should fail. """ @@ -235,8 +223,7 @@ rev_id2: dir_id2, } - @istest - def maybe_load_revisions(self): + def test_maybe_load_revisions(self): """Loading revisions should be ok """ @@ -244,8 +231,7 @@ self.assertCountRevisions(len(self.expected_revisions)) self.assertRevisionsOk(self.expected_revisions) - @istest - def send_batch_revisions(self): + def test_send_batch_revisions(self): """Sending revisions should be ok 2 """ @@ -253,8 +239,7 @@ self.assertCountRevisions(len(self.expected_revisions)) self.assertRevisionsOk(self.expected_revisions) - @istest - def failing(self): + def test_failing(self): """Comparing wrong snapshot should fail. """ @@ -308,8 +293,7 @@ } } - @istest - def maybe_load_snapshots(self): + def test_maybe_load_snapshots(self): """Loading snapshot should be ok """ @@ -320,8 +304,7 @@ self.expected_snapshot['id'], expected_branches=self.expected_snapshot['branches']) - @istest - def send_batch_snapshots(self): + def test_send_batch_snapshots(self): """Sending snapshot should be ok 2 """ @@ -332,8 +315,7 @@ self.expected_snapshot['id'], expected_branches=self.expected_snapshot['branches']) - @istest - def failing(self): + def test_failing(self): """Comparing wrong snapshot should fail. """ diff --git a/swh/loader/core/tests/test_queue.py b/swh/loader/core/tests/test_queue.py --- a/swh/loader/core/tests/test_queue.py +++ b/swh/loader/core/tests/test_queue.py @@ -5,16 +5,13 @@ import unittest -from nose.tools import istest - -from swh.loader.core.queue import QueuePerNbElements -from swh.loader.core.queue import QueuePerNbUniqueElements -from swh.loader.core.queue import QueuePerSizeAndNbUniqueElements +from swh.loader.core.queue import (QueuePerNbElements, + QueuePerNbUniqueElements, + QueuePerSizeAndNbUniqueElements) class TestQueuePerNbElements(unittest.TestCase): - @istest - def simple_queue_behavior(self): + def test_simple_queue_behavior(self): max_nb_elements = 10 queue = QueuePerNbElements(max_nb_elements=max_nb_elements) @@ -48,8 +45,7 @@ class TestQueuePerNbUniqueElements(unittest.TestCase): - @istest - def queue_with_unique_key_behavior(self): + def test_queue_with_unique_key_behavior(self): max_nb_elements = 5 queue = QueuePerNbUniqueElements(max_nb_elements=max_nb_elements, key='id') @@ -86,8 +82,7 @@ class TestQueuePerSizeAndNbUniqueElements(unittest.TestCase): - @istest - def queue_with_unique_key_and_size_behavior(self): + def test_queue_with_unique_key_and_size_behavior(self): max_nb_elements = 5 max_size = 100 queue = QueuePerSizeAndNbUniqueElements(