diff --git a/swh/loader/svn/tests/test_converters.py b/swh/loader/svn/tests/test_converters.py --- a/swh/loader/svn/tests/test_converters.py +++ b/swh/loader/svn/tests/test_converters.py @@ -5,14 +5,11 @@ import unittest -from nose.tools import istest - from swh.loader.svn import converters class TestAuthorGitSvnConverters(unittest.TestCase): - @istest - def svn_author_to_gitsvn_person(self): + def test_svn_author_to_gitsvn_person(self): """The author should have name, email and fullname filled. """ @@ -25,8 +22,7 @@ 'email': b'ynot@dagobah', }) - @istest - def svn_author_to_gitsvn_person_no_email(self): + def test_svn_author_to_gitsvn_person_no_email(self): """The author should see his/her email filled with author@. """ @@ -39,8 +35,7 @@ 'email': b'tony@some-uuid', }) - @istest - def svn_author_to_gitsvn_person_empty_person(self): + def test_svn_author_to_gitsvn_person_empty_person(self): """The empty person should see name, fullname and email filled. """ @@ -55,8 +50,7 @@ class TestAuthorConverters(unittest.TestCase): - @istest - def svn_author_to_swh_person(self): + def test_svn_author_to_swh_person(self): """The author should have name, email and fullname filled. """ @@ -68,8 +62,7 @@ 'email': b'ynot@dagobah', }) - @istest - def svn_author_to_swh_person_no_email(self): + def test_svn_author_to_swh_person_no_email(self): """The author and fullname should be the same as the input (author). """ @@ -80,8 +73,7 @@ 'email': None, }) - @istest - def svn_author_to_swh_person_empty_person(self): + def test_svn_author_to_swh_person_empty_person(self): """Empty person has only its fullname filled with the empty byte-string. @@ -95,8 +87,7 @@ class TestRevisionConverters(unittest.TestCase): - @istest - def build_swh_revision_default(self): + def test_build_swh_revision_default(self): """This should build the swh revision with the swh revision's extra headers about the repository. @@ -158,8 +149,7 @@ class TestGitSvnRevisionConverters(unittest.TestCase): - @istest - def build_gitsvn_swh_revision_default(self): + def test_build_gitsvn_swh_revision_default(self): """This should build the swh revision without the swh revision's extra headers about the repository. @@ -215,8 +205,7 @@ class ConvertDate(unittest.TestCase): - @istest - def svn_date_to_swh_date(self): + def test_svn_date_to_swh_date(self): """The timestamp should not be tampered with and include the decimals. @@ -240,8 +229,7 @@ 'offset': 0 }) - @istest - def svn_date_to_swh_date_epoch(self): + def test_svn_date_to_swh_date_epoch(self): """Empty date should be EPOCH (timestamp and offset at 0).""" # It should return 0, epoch self.assertEquals({ @@ -260,8 +248,7 @@ class ConvertGitSvnDate(unittest.TestCase): - @istest - def svn_date_to_gitsvn_date(self): + def test_svn_date_to_gitsvn_date(self): """The timestamp should be truncated to be an integer.""" actual_ts = converters.svn_date_to_gitsvn_date( '2011-05-31T06:04:39.800722Z') @@ -274,8 +261,7 @@ 'offset': 0, }) - @istest - def svn_date_to_gitsvn_date_epoch(self): + def test_svn_date_to_gitsvn_date_epoch(self): """Empty date should be EPOCH (timestamp and offset at 0).""" # It should return 0, epoch self.assertEquals({ diff --git a/swh/loader/svn/tests/test_loader.py b/swh/loader/svn/tests/test_loader.py --- a/swh/loader/svn/tests/test_loader.py +++ b/swh/loader/svn/tests/test_loader.py @@ -4,16 +4,13 @@ # See top-level LICENSE file for more information import os - -from nose.tools import istest from unittest import TestCase +from swh.loader.core.tests import BaseLoaderTest, LoaderNoStorage +from swh.loader.svn.loader import (DEFAULT_BRANCH, SvnLoader, + SvnLoaderFromRemoteDump, build_swh_snapshot) from swh.model import hashutil -from swh.loader.svn.loader import build_swh_snapshot, DEFAULT_BRANCH -from swh.loader.svn.loader import SvnLoader, SvnLoaderFromRemoteDump -from swh.loader.core.tests import LoaderNoStorage, BaseLoaderTest - class BaseSvnLoaderTest(BaseLoaderTest): """Base test loader class. @@ -29,8 +26,7 @@ class TestSnapshot(TestCase): - @istest - def build_swh_snapshot(self): + def test_build_swh_snapshot(self): actual_snap = build_swh_snapshot('revision-id') self.assertEquals(actual_snap, { @@ -162,8 +158,7 @@ super().setUp() self.loader = SvnLoaderNoStorage() - @istest - def load(self): + def test_load(self): """Load a new repository results in new swh object and snapshot """ @@ -206,8 +201,7 @@ super().setUp() self.loader = SvnLoaderUpdateNoStorage() - @istest - def load(self): + def test_load(self): """Load a repository without new changes results in same snapshot """ @@ -242,8 +236,7 @@ super().setUp(archive_name='pkg-gourmet-with-updates.tgz') self.loader = SvnLoaderUpdateHistoryAlteredNoStorage() - @istest - def load(self): + def test_load(self): """Load known repository with history altered should do nothing """ @@ -276,8 +269,7 @@ super().setUp(archive_name='pkg-gourmet-with-updates.tgz') self.loader = SvnLoaderUpdateNoStorage() - @istest - def process_repository(self): + def test_process_repository(self): """Process updated repository should yield new objects """ @@ -324,8 +316,7 @@ super().setUp(archive_name='pkg-gourmet-with-updates.tgz') self.loader = SvnLoaderUpdateNoStorage() - @istest - def load(self): + def test_load(self): """Load an existing repository from scratch yields same swh objects """ @@ -412,8 +403,7 @@ super().setUp(archive_name='pkg-gourmet-with-updates.tgz') self.loader = SvnLoaderWithPreviousRevisionNoStorage() - @istest - def load(self): + def test_load(self): """Load from partial previous visit result in new changes """ @@ -459,8 +449,7 @@ super().setUp(archive_name='pkg-gourmet-with-updates.tgz') self.loader = SvnLoaderUpdateNoStorage() - @istest - def load(self): + def test_load(self): """Load known and partial repository should start from last visit """ @@ -561,8 +550,7 @@ super().setUp(archive_name='pkg-gourmet-with-updates.tgz') self.loader = SvnLoaderUpdateLessRecentNoStorage() - @istest - def load(self): + def test_load(self): """Load repository should yield revisions starting from last visit """ @@ -625,8 +613,7 @@ filename='mediawiki-repo-r407-eol-native-crlf') self.loader = SvnLoaderNoStorage() - @istest - def process_repository(self): + def test_process_repository(self): """Load repository with CRLF endings (svn:eol-style: native) is ok """ # noqa @@ -659,8 +646,7 @@ filename='pyang-repo-r343-eol-native-mixed-lf-crlf') self.loader = SvnLoaderNoStorage() - @istest - def load(self): + def test_load(self): """Load repo with mixed CRLF/LF endings (svn:eol-style:native) is ok """ @@ -690,8 +676,7 @@ super().setUp(archive_name='pkg-gourmet-with-external-id.tgz') self.loader = SvnLoaderNoStorage() - @istest - def load(self): + def test_load(self): """Repository with svn:externals property, will stop raising an error """ @@ -754,8 +739,7 @@ archive_name='pkg-gourmet-with-edge-case-links-and-files.tgz') self.loader = SvnLoaderNoStorage() - @istest - def load(self): + def test_load(self): """File/Link removed prior to folder with same name creation is ok """ @@ -813,8 +797,7 @@ archive_name='pkg-gourmet-with-wrong-link-cases.tgz') self.loader = SvnLoaderNoStorage() - @istest - def load(self): + def test_load(self): """Wrong link or empty space-named link should be ok """ @@ -885,8 +868,7 @@ def setUp(self): super().setUp(archive_name='pkg-gourmet.tgz') - @istest - def load(self): + def test_load(self): """ Compare results of remote dump loader and base loader """ @@ -916,8 +898,7 @@ super().setUp(archive_name='httthttt.tgz', filename='httthttt') self.loader = SvnLoaderNoStorage() - @istest - def load(self): + def test_load(self): """Decoding user defined svn properties error should not fail loading """ diff --git a/swh/loader/svn/tests/test_utils.py b/swh/loader/svn/tests/test_utils.py --- a/swh/loader/svn/tests/test_utils.py +++ b/swh/loader/svn/tests/test_utils.py @@ -5,14 +5,11 @@ import unittest -from nose.tools import istest - from swh.loader.svn import utils class TestUtils(unittest.TestCase): - @istest - def strdate_to_timestamp(self): + def test_strdate_to_timestamp(self): """Formatted string date should be converted in timestamp.""" actual_ts = utils.strdate_to_timestamp('2011-05-31T06:04:39.800722Z') self.assertEquals(actual_ts, {'seconds': 1306821879, @@ -22,8 +19,7 @@ self.assertEquals(actual_ts, {'seconds': 1306821819, 'microseconds': 123450}) - @istest - def strdate_to_timestamp_empty_does_not_break(self): + def test_strdate_to_timestamp_empty_does_not_break(self): """Empty or None date should be timestamp 0.""" self.assertEquals({'seconds': 0, 'microseconds': 0}, utils.strdate_to_timestamp(''))