Beispiel #1
0
 def test_fetch_document_is_called(self, mock_fetch, mock_xrd):
     mock_fetch.return_value = "document", None, None
     mock_xrd.return_value = "document"
     document = retrieve_diaspora_host_meta("localhost")
     mock_fetch.assert_called_with(host="localhost",
                                   path="/.well-known/host-meta")
     assert document == "document"
 def test_returns_none_on_fetch_document_exception(self, mock_fetch):
     mock_fetch.return_value = None, None, ValueError()
     document = retrieve_diaspora_host_meta("localhost")
     mock_fetch.assert_called_with(host="localhost", path="/.well-known/host-meta")
     assert document == None
 def test_returns_none_on_fetch_document_exception(self, mock_fetch):
     mock_fetch.return_value = None, None, ValueError()
     document = retrieve_diaspora_host_meta("localhost")
     mock_fetch.assert_called_with(host="localhost", path="/.well-known/host-meta")
     assert document == None
 def test_fetch_document_is_called(self, mock_fetch, mock_xrd):
     mock_fetch.return_value = "document", None, None
     mock_xrd.return_value = "document"
     document = retrieve_diaspora_host_meta("localhost")
     mock_fetch.assert_called_with(host="localhost", path="/.well-known/host-meta")
     assert document == "document"