forked from scrapy/scrapy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_toplevel.py
34 lines (25 loc) · 1.01 KB
/
test_toplevel.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from unittest import TestCase
import six
import scrapy
class ToplevelTestCase(TestCase):
def test_version(self):
self.assertIs(type(scrapy.__version__), six.text_type)
def test_version_info(self):
self.assertIs(type(scrapy.version_info), tuple)
def test_optional_features(self):
self.assertIs(type(scrapy.optional_features), set)
self.assertIn('ssl', scrapy.optional_features)
def test_request_shortcut(self):
from scrapy.http import Request, FormRequest
self.assertIs(scrapy.Request, Request)
self.assertIs(scrapy.FormRequest, FormRequest)
def test_spider_shortcut(self):
from scrapy.spider import Spider
self.assertIs(scrapy.Spider, Spider)
def test_selector_shortcut(self):
from scrapy.selector import Selector
self.assertIs(scrapy.Selector, Selector)
def test_item_shortcut(self):
from scrapy.item import Item, Field
self.assertIs(scrapy.Item, Item)
self.assertIs(scrapy.Field, Field)