Exemplo n.º 1
0
class TestCollectionFactory(unittest.TestCase):

    def setUp(self):
        self.collection_factory = CollectionFactory()

    @mock.patch('xcrawler.collections.collection_factory.FallbackList')
    def test_create_selector_css(self, mock_fallback_list_class):
        mock_list = ["mock1", "mock2", "mock3"]
        mock_fallback_list_instance = mock.create_autospec(FallbackList).return_value
        mock_fallback_list_class.return_value = mock_fallback_list_instance
        self.collection_factory.create_fallback_list(mock_list)
        mock_fallback_list_class.assert_called_once_with(mock_list)
Exemplo n.º 2
0
class TestCollectionFactory(unittest.TestCase):
    def setUp(self):
        self.collection_factory = CollectionFactory()

    @mock.patch('xcrawler.collections.collection_factory.FallbackList')
    def test_create_selector_css(self, mock_fallback_list_class):
        mock_list = ["mock1", "mock2", "mock3"]
        mock_fallback_list_instance = mock.create_autospec(
            FallbackList).return_value
        mock_fallback_list_class.return_value = mock_fallback_list_instance
        self.collection_factory.create_fallback_list(mock_list)
        mock_fallback_list_class.assert_called_once_with(mock_list)
Exemplo n.º 3
0
 def __init__(self,
              root_element=None,
              collection_factory=CollectionFactory(),
              string_converter=StringConverter()):
     self.root_element = root_element
     self.collection_factory = collection_factory
     self.string_converter = string_converter
Exemplo n.º 4
0
 def setUp(self):
     self.collection_factory = CollectionFactory()
Exemplo n.º 5
0
 def setUp(self):
     self.collection_factory = CollectionFactory()