Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9338947
D526.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
17 KB
Subscribers
None
D526.diff
View Options
diff --git a/swh/indexer/tests/storage/test_converters.py b/swh/indexer/tests/storage/test_converters.py
--- a/swh/indexer/tests/storage/test_converters.py
+++ b/swh/indexer/tests/storage/test_converters.py
@@ -5,7 +5,6 @@
import unittest
-from nose.tools import istest
from nose.plugins.attrib import attr
from swh.indexer.storage import converters
@@ -16,8 +15,7 @@
def setUp(self):
self.maxDiff = None
- @istest
- def ctags_to_db(self):
+ def test_ctags_to_db(self):
input_ctag = {
'id': b'some-id',
'indexer_configuration_id': 100,
@@ -59,8 +57,7 @@
# then
self.assertEquals(actual_ctags, expected_ctags)
- @istest
- def db_to_ctags(self):
+ def test_db_to_ctags(self):
input_ctags = {
'id': b'some-id',
'name': 'some-name',
@@ -92,8 +89,7 @@
# then
self.assertEquals(actual_ctags, expected_ctags)
- @istest
- def db_to_mimetype(self):
+ def test_db_to_mimetype(self):
input_mimetype = {
'id': b'some-id',
'tool_id': 10,
@@ -120,8 +116,7 @@
self.assertEquals(actual_mimetype, expected_mimetype)
- @istest
- def db_to_language(self):
+ def test_db_to_language(self):
input_language = {
'id': b'some-id',
'tool_id': 20,
@@ -146,8 +141,7 @@
self.assertEquals(actual_language, expected_language)
- @istest
- def db_to_fossology_license(self):
+ def test_db_to_fossology_license(self):
input_license = {
'id': b'some-id',
'tool_id': 20,
@@ -171,8 +165,7 @@
self.assertEquals(actual_license, expected_license)
- @istest
- def db_to_metadata(self):
+ def test_db_to_metadata(self):
input_metadata = {
'id': b'some-id',
'tool_id': 20,
diff --git a/swh/indexer/tests/storage/test_storage.py b/swh/indexer/tests/storage/test_storage.py
--- a/swh/indexer/tests/storage/test_storage.py
+++ b/swh/indexer/tests/storage/test_storage.py
@@ -6,7 +6,6 @@
import pathlib
import unittest
-from nose.tools import istest
from nose.plugins.attrib import attr
from swh.model.hashutil import hash_to_bytes
@@ -104,13 +103,11 @@
"""
- @istest
- def check_config(self):
+ def test_check_config(self):
self.assertTrue(self.storage.check_config(check_write=True))
self.assertTrue(self.storage.check_config(check_write=False))
- @istest
- def content_mimetype_missing(self):
+ def test_content_mimetype_missing(self):
# given
tool_id = self.tools['file']['id']
@@ -147,8 +144,7 @@
# then
self.assertEqual(list(actual_missing), [self.sha1_1])
- @istest
- def content_mimetype_add__drop_duplicate(self):
+ def test_content_mimetype_add__drop_duplicate(self):
# given
tool_id = self.tools['file']['id']
@@ -190,8 +186,7 @@
# mimetype did not change as the v2 was dropped.
self.assertEqual(actual_mimetypes, expected_mimetypes_v1)
- @istest
- def content_mimetype_add__update_in_place_duplicate(self):
+ def test_content_mimetype_add__update_in_place_duplicate(self):
# given
tool_id = self.tools['file']['id']
@@ -246,8 +241,7 @@
# mimetype did change as the v2 was used to overwrite v1
self.assertEqual(actual_mimetypes, expected_mimetypes_v2)
- @istest
- def content_mimetype_get(self):
+ def test_content_mimetype_get(self):
# given
tool_id = self.tools['file']['id']
@@ -276,8 +270,7 @@
self.assertEqual(actual_mimetypes, expected_mimetypes)
- @istest
- def content_language_missing(self):
+ def test_content_language_missing(self):
# given
tool_id = self.tools['pygments']['id']
@@ -314,8 +307,7 @@
# then
self.assertEqual(actual_missing, [self.sha1_1])
- @istest
- def content_language_get(self):
+ def test_content_language_get(self):
# given
tool_id = self.tools['pygments']['id']
@@ -341,8 +333,7 @@
self.assertEqual(actual_languages, expected_languages)
- @istest
- def content_language_add__drop_duplicate(self):
+ def test_content_language_add__drop_duplicate(self):
# given
tool_id = self.tools['pygments']['id']
@@ -381,8 +372,7 @@
# language did not change as the v2 was dropped.
self.assertEqual(actual_languages, expected_languages_v1)
- @istest
- def content_language_add__update_in_place_duplicate(self):
+ def test_content_language_add__update_in_place_duplicate(self):
# given
tool_id = self.tools['pygments']['id']
@@ -428,8 +418,7 @@
# language did change as the v2 was used to overwrite v1
self.assertEqual(actual_languages, expected_languages_v2)
- @istest
- def content_ctags_missing(self):
+ def test_content_ctags_missing(self):
# given
tool_id = self.tools['universal-ctags']['id']
@@ -473,8 +462,7 @@
# then
self.assertEqual(list(actual_missing), [self.sha1_1])
- @istest
- def content_ctags_get(self):
+ def test_content_ctags_get(self):
# given
tool_id = self.tools['universal-ctags']['id']
@@ -527,8 +515,7 @@
self.assertEqual(actual_ctags, expected_ctags)
- @istest
- def content_ctags_search(self):
+ def test_content_ctags_search(self):
# 1. given
tool = self.tools['universal-ctags']
tool_id = tool['id']
@@ -637,14 +624,12 @@
'lang': 'Python',
}])
- @istest
- def content_ctags_search_no_result(self):
+ def test_content_ctags_search_no_result(self):
actual_ctags = list(self.storage.content_ctags_search('counter'))
self.assertEquals(actual_ctags, [])
- @istest
- def content_ctags_add__add_new_ctags_added(self):
+ def test_content_ctags_add__add_new_ctags_added(self):
# given
tool = self.tools['universal-ctags']
tool_id = tool['id']
@@ -718,8 +703,7 @@
self.assertEqual(actual_ctags, expected_ctags)
- @istest
- def content_ctags_add__update_in_place(self):
+ def test_content_ctags_add__update_in_place(self):
# given
tool = self.tools['universal-ctags']
tool_id = tool['id']
@@ -800,8 +784,7 @@
]
self.assertEqual(actual_ctags, expected_ctags)
- @istest
- def content_fossology_license_get(self):
+ def test_content_fossology_license_get(self):
# given
tool = self.tools['nomos']
tool_id = tool['id']
@@ -829,8 +812,7 @@
# then
self.assertEqual(actual_licenses, [expected_license])
- @istest
- def content_fossology_license_add__new_license_added(self):
+ def test_content_fossology_license_add__new_license_added(self):
# given
tool = self.tools['nomos']
tool_id = tool['id']
@@ -880,8 +862,7 @@
# license did not change as the v2 was dropped.
self.assertEqual(actual_licenses, [expected_license])
- @istest
- def content_fossology_license_add__update_in_place_duplicate(self):
+ def test_content_fossology_license_add__update_in_place_duplicate(self):
# given
tool = self.tools['nomos']
tool_id = tool['id']
@@ -931,8 +912,7 @@
}
self.assertEqual(actual_licenses, [expected_license])
- @istest
- def content_metadata_missing(self):
+ def test_content_metadata_missing(self):
# given
tool_id = self.tools['swh-metadata-translator']['id']
@@ -978,8 +958,7 @@
# then
self.assertEqual(actual_missing, [self.sha1_1])
- @istest
- def content_metadata_get(self):
+ def test_content_metadata_get(self):
# given
tool_id = self.tools['swh-metadata-translator']['id']
@@ -1022,8 +1001,7 @@
self.assertEqual(actual_metadata, expected_metadata)
- @istest
- def content_metadata_add_drop_duplicate(self):
+ def test_content_metadata_add_drop_duplicate(self):
# given
tool_id = self.tools['swh-metadata-translator']['id']
@@ -1075,8 +1053,7 @@
# metadata did not change as the v2 was dropped.
self.assertEqual(actual_metadata, expected_metadata_v1)
- @istest
- def content_metadata_add_update_in_place_duplicate(self):
+ def test_content_metadata_add_update_in_place_duplicate(self):
# given
tool_id = self.tools['swh-metadata-translator']['id']
@@ -1137,8 +1114,7 @@
# metadata did change as the v2 was used to overwrite v1
self.assertEqual(actual_metadata, expected_metadata_v2)
- @istest
- def revision_metadata_missing(self):
+ def test_revision_metadata_missing(self):
# given
tool_id = self.tools['swh-metadata-detector']['id']
@@ -1194,8 +1170,7 @@
# then
self.assertEqual(actual_missing, [self.revision_id_2])
- @istest
- def revision_metadata_get(self):
+ def test_revision_metadata_get(self):
# given
tool_id = self.tools['swh-metadata-detector']['id']
@@ -1237,8 +1212,7 @@
self.assertEqual(actual_metadata, expected_metadata)
- @istest
- def revision_metadata_add_drop_duplicate(self):
+ def test_revision_metadata_add_drop_duplicate(self):
# given
tool_id = self.tools['swh-metadata-detector']['id']
@@ -1298,8 +1272,7 @@
# metadata did not change as the v2 was dropped.
self.assertEqual(actual_metadata, expected_metadata_v1)
- @istest
- def revision_metadata_add_update_in_place_duplicate(self):
+ def test_revision_metadata_add_update_in_place_duplicate(self):
# given
tool_id = self.tools['swh-metadata-detector']['id']
@@ -1364,8 +1337,7 @@
# metadata did change as the v2 was used to overwrite v1
self.assertEqual(actual_metadata, expected_metadata_v2)
- @istest
- def indexer_configuration_add(self):
+ def test_indexer_configuration_add(self):
tool = {
'tool_name': 'some-unknown-tool',
'tool_version': 'some-version',
@@ -1392,8 +1364,7 @@
self.assertEqual(new_id, new_id2)
self.assertEqual(actual_tool, actual_tool2)
- @istest
- def indexer_configuration_add_multiple(self):
+ def test_indexer_configuration_add_multiple(self):
tool = {
'tool_name': 'some-unknown-tool',
'tool_version': 'some-version',
@@ -1418,8 +1389,7 @@
self.assertIsNotNone(_id)
self.assertIn(tool, new_tools)
- @istest
- def indexer_configuration_get_missing(self):
+ def test_indexer_configuration_get_missing(self):
tool = {
'tool_name': 'unknown-tool',
'tool_version': '3.1.0rc2-31-ga2cbb8c',
@@ -1430,8 +1400,7 @@
self.assertIsNone(actual_tool)
- @istest
- def indexer_configuration_get(self):
+ def test_indexer_configuration_get(self):
tool = {
'tool_name': 'nomos',
'tool_version': '3.1.0rc2-31-ga2cbb8c',
@@ -1445,8 +1414,7 @@
self.assertEqual(expected_tool, actual_tool)
- @istest
- def indexer_configuration_metadata_get_missing_context(self):
+ def test_indexer_configuration_metadata_get_missing_context(self):
tool = {
'tool_name': 'swh-metadata-translator',
'tool_version': '0.0.1',
@@ -1457,8 +1425,7 @@
self.assertIsNone(actual_tool)
- @istest
- def indexer_configuration_metadata_get(self):
+ def test_indexer_configuration_metadata_get(self):
tool = {
'tool_name': 'swh-metadata-translator',
'tool_version': '0.0.1',
diff --git a/swh/indexer/tests/test_language.py b/swh/indexer/tests/test_language.py
--- a/swh/indexer/tests/test_language.py
+++ b/swh/indexer/tests/test_language.py
@@ -5,7 +5,6 @@
import unittest
import logging
-from nose.tools import istest
from swh.indexer import language
from swh.indexer.language import ContentLanguageIndexer
from swh.indexer.tests.test_utils import MockObjStorage
@@ -60,7 +59,6 @@
def setUp(self):
self.maxDiff = None
- @istest
def test_compute_language_none(self):
# given
self.content = ""
@@ -72,7 +70,6 @@
# then
self.assertEqual(self.declared_language, result)
- @istest
def test_index_content_language_python(self):
# given
# testing python
@@ -91,7 +88,6 @@
# then
self.assertEqual(expected_results, results)
- @istest
def test_index_content_language_c(self):
# given
# testing c
diff --git a/swh/indexer/tests/test_metadata.py b/swh/indexer/tests/test_metadata.py
--- a/swh/indexer/tests/test_metadata.py
+++ b/swh/indexer/tests/test_metadata.py
@@ -5,7 +5,6 @@
import unittest
import logging
-from nose.tools import istest
from swh.indexer.metadata_dictionary import compute_metadata
from swh.indexer.metadata_detector import detect_metadata
@@ -88,7 +87,6 @@
}
}
- @istest
def test_compute_metadata_none(self):
"""
testing content empty content is empty
@@ -105,7 +103,6 @@
# then
self.assertEqual(declared_metadata, result)
- @istest
def test_compute_metadata_npm(self):
"""
testing only computation of metadata with hard_mapping_npm
@@ -138,7 +135,6 @@
# then
self.assertEqual(declared_metadata, result)
- @istest
def test_extract_minimal_metadata_dict(self):
"""
Test the creation of a coherent minimal metadata set
@@ -196,7 +192,6 @@
}
self.assertEqual(expected_results, results)
- @istest
def test_index_content_metadata_npm(self):
"""
testing NPM with package.json
@@ -280,7 +275,6 @@
# The assertion below returns False sometimes because of nested lists
self.assertEqual(expected_results, results)
- @istest
def test_detect_metadata_package_json(self):
# given
df = [{
@@ -316,7 +310,6 @@
# then
self.assertEqual(expected_results, results)
- @istest
def test_revision_metadata_indexer(self):
metadata_indexer = TestRevisionMetadataIndexer()
diff --git a/swh/indexer/tests/test_mimetype.py b/swh/indexer/tests/test_mimetype.py
--- a/swh/indexer/tests/test_mimetype.py
+++ b/swh/indexer/tests/test_mimetype.py
@@ -5,7 +5,6 @@
import unittest
import logging
-from nose.tools import istest
from swh.indexer.mimetype import ContentMimetypeIndexer
@@ -65,8 +64,7 @@
class TestMimetypeIndexerWithErrors(unittest.TestCase):
- @istest
- def wrong_unknown_configuration_tool(self):
+ def test_wrong_unknown_configuration_tool(self):
"""Indexer with unknown configuration tool should fail the check"""
with self.assertRaisesRegex(ValueError, 'Tools None is unknown'):
TestMimetypeIndexerUnknownToolStorage()
@@ -76,7 +74,6 @@
def setUp(self):
self.indexer = TestMimetypeIndexer()
- @istest
def test_index_no_update(self):
# given
sha1s = [
@@ -103,7 +100,6 @@
self.assertFalse(self.indexer.idx_storage.conflict_update)
self.assertEquals(expected_results, self.indexer.idx_storage.state)
- @istest
def test_index_update(self):
# given
sha1s = [
@@ -136,7 +132,6 @@
self.assertTrue(self.indexer.idx_storage.conflict_update)
self.assertEquals(expected_results, self.indexer.idx_storage.state)
- @istest
def test_index_one_unknown_sha1(self):
# given
sha1s = ['688a5ef812c53907562fe379d4b3851e69c7cb15',
diff --git a/swh/indexer/tests/test_orchestrator.py b/swh/indexer/tests/test_orchestrator.py
--- a/swh/indexer/tests/test_orchestrator.py
+++ b/swh/indexer/tests/test_orchestrator.py
@@ -4,7 +4,6 @@
# See top-level LICENSE file for more information
import unittest
-from nose.tools import istest
from swh.indexer.orchestrator import BaseOrchestratorIndexer
from swh.indexer.indexer import RevisionIndexer
@@ -106,8 +105,7 @@
class OrchestratorTest(unittest.TestCase):
maxDiff = None
- @istest
- def orchestrator_filter(self):
+ def test_orchestrator_filter(self):
o = TestOrchestrator12()
o.prepare()
o.run(['id12', 'id2'])
@@ -130,8 +128,7 @@
'task': 'swh.indexer.tests.test_orchestrator.Indexer2Task'},
])
- @istest
- def orchestrator_batch(self):
+ def test_orchestrator_batch(self):
o = TestOrchestrator12()
o.prepare()
o.run(['id12', 'id2a', 'id2b', 'id2c'])
diff --git a/swh/indexer/tests/test_utils.py b/swh/indexer/tests/test_utils.py
--- a/swh/indexer/tests/test_utils.py
+++ b/swh/indexer/tests/test_utils.py
@@ -21,7 +21,6 @@
'02fb2c89e14f7fab46701478c83779c7beb7b069': b"""
import unittest
import logging
- from nose.tools import istest
from swh.indexer.mimetype import ContentMimetypeIndexer
from swh.indexer.tests.test_utils import MockObjStorage
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Jul 3 2025, 9:16 AM (6 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3221485
Attached To
D526: Rename test methods to test_* to allow collection by pytest
Event Timeline
Log In to Comment