def test_default_processes(self, mock_cpu_count): """Test handling of cpu_count() erroring. Could happen when cpu_count isn't implemented on a platform and --processes isn't specified by the user. """ mock_cpu_count.side_effect = NotImplementedError args = wc._parse_args(['--crawl', '12']) assert args.processes == 1
def test_SetQueryParametersAction_multiple_collections(self): """Test multiple collections end up in query_params. A query can have multiple collections, so test that the user can supply multiple values. """ args = wc._parse_args(['--collection', '12345', '98', '--crawl', '12']) assert len(args.query_params) == 2 assert args.query_params['collection'] == ['12345', '98']
def test_SetQueryParametersAction(self): """Test that arguments passed with this action are in query_params.""" args = wc._parse_args([ '--crawl-start-after', '2016-12-22T13:01:00', '--crawl-start-before', '2016-12-22T15:11:00', '-c' ]) assert len(args.query_params) == 2 assert args.query_params['crawl-start-after'] == '2016-12-22T13:01:00' assert args.query_params['crawl-start-before'] == '2016-12-22T15:11:00'