def test_apikey_authentication_uses_auth_method(self, key, mock_auth, resources_server):
     """Test that the api key authentication is passed through to the auth module."""
     main(args=["--apikey={}".format(key), resources_server.url], standalone_mode=False)
     mock_auth.api_key.assert_called_once_with(key)
 def main_error():
     main(args=params + [resources_server.url])
 def test_no_authentication_is_default(self, mock_auth, resources_server):
     """Test that a call to auth.none exits."""
     main(args=[resources_server.url], standalone_mode=False)
     mock_auth.none.assert_called_once_with()
 def test_basic_authentication_uses_auth_method(
         self, mock_auth, username, password, resources_server):
     """Test that basic authentication provides the username and password."""
     main(args=["--basic={}:{}".format(username, password), resources_server.url], standalone_mode=False)
     mock_auth.basic.assert_called_once_with(username, password)
 def assert_main_calls(args, expected_calls):
     """Make sure the calls to the client are expected."""
     main(args=args, standalone_mode=False)
     calls = mock_client().mock_calls
     assert calls == expected_calls
 def test_the__id(self, mock_client, _id, args):
     """Make sure that the default id is url-crawler."""
     main(args=["asdasda"] + args, standalone_mode=False)
     assert mock_client.call_count == 1
     arguments = mock_client.mock_calls[0][1]
     assert arguments[1] == _id
 def main_error():
     main(args=params + [url401])
 def main_error():
     main(args=["https://localhost:80/"])
 def main_error():
     main(args=[invalid_basic, resources_server.url])
Ejemplo n.º 10
0
 def use_api_apikey_authentication(urls):
     main(args=["--apikey=abcdefghijklmn", resources_server.url] + urls,
          standalone_mode=False)
Ejemplo n.º 11
0
 def use_api_basic_authentication(urls):
     main(args=[
         "[email protected]:123abc", resources_server.url
     ] + urls,
          standalone_mode=False)
Ejemplo n.º 12
0
 def use_api_without_authentication(urls):
     main(args=[resources_server.url] + urls, standalone_mode=False)
Ejemplo n.º 13
0
from schul_cloud_url_crawler.cli import main

main()