Pārlūkot izejas kodu

Change assertTrue(isinstance()) by optimal assert

Some of tests use different method of
assertTrue(isinstance(A, B)) or assertEqual(type(A), B).
The correct way is to use assertIsInstance(A, B) provided
by testtools

Change-Id: Ib8dec9d44ce66b1b7ff1486a234fae73d29f23ff
tags/1.2.1
gecong1973 pirms 3 gadiem
vecāks
revīzija
52d9c52723
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. +2
    -2
      sitemap/test/generator/test_pipelines.py

+ 2
- 2
sitemap/test/generator/test_pipelines.py Parādīt failu

@@ -37,7 +37,7 @@ class TestIgnoreDuplicateUrls(unittest.TestCase):
self.ignore_urls = pipelines.IgnoreDuplicateUrls()

def test_set_is_set_at_init(self):
self.assertTrue(isinstance(self.ignore_urls.processed, set))
self.assertIsInstance(self.ignore_urls.processed, set)

def test_set_is_empty_at_init(self):
self.assertEqual(len(self.ignore_urls.processed), 0)
@@ -72,7 +72,7 @@ class TestExportSitemap(unittest.TestCase):
self.spider = mock.MagicMock()

def test_variables_set_at_init(self):
self.assertTrue(isinstance(self.export_sitemap.files, dict))
self.assertIsInstance(self.export_sitemap.files, dict)
self.assertTrue(self.export_sitemap.exporter is None)

def test_spider_opened_calls_open(self):


Notiek ielāde…
Atcelt
Saglabāt