Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 806 for Wain (0.21 sec)

  1. docs_src/app_testing/app_b_an_py39/main.py

    }
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        id: str
        title: str
        description: Union[str, None] = None
    
    
    @app.get("/items/{item_id}", response_model=Item)
    async def read_main(item_id: str, x_token: Annotated[str, Header()]):
        if x_token != fake_secret_token:
            raise HTTPException(status_code=400, detail="Invalid X-Token header")
        if item_id not in fake_db:
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 1.1K bytes
    - Viewed (0)
  2. docs/debugging/xl-meta/main.go

    // GNU Affero General Public License for more details.
    //
    // You should have received a copy of the GNU Affero General Public License
    // along with this program.  If not, see <http://www.gnu.org/licenses/>.
    
    package main
    
    import (
    	"bytes"
    	"encoding/binary"
    	"encoding/hex"
    	"encoding/json"
    	"errors"
    	"fmt"
    	"io"
    	"log"
    	"os"
    	"path/filepath"
    	"sort"
    	"strings"
    	"time"
    
    	"github.com/google/uuid"
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Apr 19 16:43:43 GMT 2024
    - 19.7K bytes
    - Viewed (1)
  3. misc/go_android_exec/main.go

    //go:build darwin || dragonfly || freebsd || illumos || linux || netbsd || openbsd
    
    // This program can be used as go_android_GOARCH_exec by the Go tool.
    // It executes binaries on an android device using adb.
    package main
    
    import (
    	"bytes"
    	"errors"
    	"fmt"
    	"io"
    	"log"
    	"os"
    	"os/exec"
    	"os/signal"
    	"path"
    	"path/filepath"
    	"regexp"
    	"runtime"
    	"strconv"
    	"strings"
    	"sync"
    	"syscall"
    )
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Mon Aug 21 17:46:57 GMT 2023
    - 15.3K bytes
    - Viewed (0)
  4. .github/actions/notify-translations/app/main.py

            comment_id=comment_id,
            body=body,
        )
        response = UpdateCommentResponse.parse_obj(data)
        return response.data.updateDiscussionComment.comment
    
    
    if __name__ == "__main__":
        settings = Settings()
        if settings.input_debug:
            logging.basicConfig(level=logging.DEBUG)
        else:
            logging.basicConfig(level=logging.INFO)
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Sep 27 23:01:46 GMT 2023
    - 12.4K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_testing/test_main.py

    from docs_src.app_testing.test_main import client, test_read_main
    
    
    def test_main():
        test_read_main()
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "openapi": "3.1.0",
            "info": {"title": "FastAPI", "version": "0.1.0"},
            "paths": {
                "/": {
                    "get": {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 819 bytes
    - Viewed (0)
  6. .github/actions/people/app/main.py

                        "count": count,
                        "avatarUrl": author.avatarUrl,
                        "url": author.url,
                    }
                )
        return users
    
    
    if __name__ == "__main__":
        logging.basicConfig(level=logging.INFO)
        settings = Settings()
        logging.info(f"Using config: {settings.model_dump_json()}")
        g = Github(settings.input_token.get_secret_value())
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Mar 26 17:38:21 GMT 2024
    - 19.2K bytes
    - Viewed (1)
  7. docs_src/async_tests/test_main.py

    import pytest
    from httpx import AsyncClient
    
    from .main import app
    
    
    @pytest.mark.anyio
    async def test_root():
        async with AsyncClient(app=app, base_url="http://test") as ac:
            response = await ac.get("/")
        assert response.status_code == 200
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Oct 06 15:32:11 GMT 2021
    - 306 bytes
    - Viewed (0)
  8. docs_src/app_testing/app_b_an/test_main.py

    from fastapi.testclient import TestClient
    
    from .main import app
    
    client = TestClient(app)
    
    
    def test_read_item():
        response = client.get("/items/foo", headers={"X-Token": "coneofsilence"})
        assert response.status_code == 200
        assert response.json() == {
            "id": "foo",
            "title": "Foo",
            "description": "There goes my hero",
        }
    
    
    def test_read_item_bad_token():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 1.8K bytes
    - Viewed (0)
  9. docs_src/settings/app02_an/test_main.py

    from fastapi.testclient import TestClient
    
    from .config import Settings
    from .main import app, get_settings
    
    client = TestClient(app)
    
    
    def get_settings_override():
        return Settings(admin_email="******@****.***")
    
    
    app.dependency_overrides[get_settings] = get_settings_override
    
    
    def test_app():
        response = client.get("/info")
        data = response.json()
        assert data == {
            "app_name": "Awesome API",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 515 bytes
    - Viewed (0)
  10. docs_src/settings/app03/main.py

    Sebastián Ramírez <******@****.***> 1698179166 +0400
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 412 bytes
    - Viewed (0)
Back to top