Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 22 for is_closed (0.2 sec)

  1. tests/test_datastructures.py

    
    def test_default_placeholder_bool():
        placeholder_a = Default("a")
        placeholder_b = Default("")
        assert placeholder_a
        assert not placeholder_b
    
    
    def test_upload_file_is_closed(tmp_path: Path):
        path = tmp_path / "test.txt"
        path.write_bytes(b"<file content>")
        app = FastAPI()
    
        testing_file_store: List[UploadFile] = []
    
        @app.post("/uploadfile/")
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Oct 18 12:36:40 GMT 2023
    - 2K bytes
    - Viewed (0)
  2. docs_src/sql_databases_peewee/sql_app/main.py

        database.db._state.reset()
    
    
    def get_db(db_state=Depends(reset_db_state)):
        try:
            database.db.connect()
            yield
        finally:
            if not database.db.is_closed():
                database.db.close()
    
    
    @app.post("/users/", response_model=schemas.User, dependencies=[Depends(get_db)])
    def create_user(user: schemas.UserCreate):
        db_user = crud.get_user_by_email(email=user.email)
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 2.2K bytes
    - Viewed (0)
  3. internal/lock/lock_test.go

    			t.Fatal(err)
    		}
    	}()
    
    	rlk, err := RLockedOpenFile(f.Name())
    	if err != nil {
    		t.Fatal(err)
    	}
    	isClosed := rlk.IsClosed()
    	if isClosed {
    		t.Fatal("File ref count shouldn't be zero")
    	}
    
    	// Increase reference count to 2.
    	rlk.IncLockRef()
    
    	isClosed = rlk.IsClosed()
    	if isClosed {
    		t.Fatal("File ref count shouldn't be zero")
    	}
    
    	// Decrease reference count by 1.
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Mon Sep 19 18:05:16 GMT 2022
    - 3.6K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/internal/connection/ConnectionPoolTest.kt

        assertThat(c1.socket().isClosed).isFalse()
        assertThat(c2.socket().isClosed).isFalse()
    
        // Add a third connection
        val c3 = factory.newConnection(pool, routeC1, 75L)
    
        // The third connection bounces the first.
        assertThat(pool.closeConnections(100L)).isEqualTo(0L)
        assertThat(pool.connectionCount()).isEqualTo(2)
        assertThat(c1.socket().isClosed).isTrue()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 24 04:40:49 GMT 2024
    - 12.7K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/io/CloserTest.java

        TestCloseable c3 = closer.register(TestCloseable.normal());
    
        assertFalse(c1.isClosed());
        assertFalse(c2.isClosed());
        assertFalse(c3.isClosed());
    
        closer.close();
    
        assertTrue(c1.isClosed());
        assertTrue(c2.isClosed());
        assertTrue(c3.isClosed());
    
        assertTrue(suppressor.suppressions.isEmpty());
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Mar 06 15:15:46 GMT 2024
    - 13.6K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/internal/cache2/RelayTest.kt

        val source2 = relay.newSource()
        source1!!.close()
        source1.close() // Unnecessary. Shouldn't decrement the reference count.
        assertThat(relay.isClosed).isFalse()
        source2!!.close()
        assertThat(relay.isClosed).isTrue()
        assertFile(Relay.PREFIX_DIRTY, -1L, -1, null, null)
      }
    
      @Test
      fun racingReaders() {
        val pipe = Pipe(1024)
        val sink = pipe.sink.buffer()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 11 22:09:35 GMT 2024
    - 8.1K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/io/CloserTest.java

        TestCloseable c3 = closer.register(TestCloseable.normal());
    
        assertFalse(c1.isClosed());
        assertFalse(c2.isClosed());
        assertFalse(c3.isClosed());
    
        closer.close();
    
        assertTrue(c1.isClosed());
        assertTrue(c2.isClosed());
        assertTrue(c3.isClosed());
    
        assertTrue(suppressor.suppressions.isEmpty());
      }
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Mar 06 15:15:46 GMT 2024
    - 13.6K bytes
    - Viewed (0)
  8. internal/lock/lock.go

    // has reached zero, i.e when all the readers have given up their locks.
    type RLockedFile struct {
    	*LockedFile
    	mutex sync.Mutex
    	refs  int // Holds read lock refs.
    }
    
    // IsClosed - Check if the rlocked file is already closed.
    func (r *RLockedFile) IsClosed() bool {
    	r.mutex.Lock()
    	defer r.mutex.Unlock()
    	return r.refs == 0
    }
    
    // IncLockRef - is used by called to indicate lock refs.
    func (r *RLockedFile) IncLockRef() {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Sun Jan 02 17:15:06 GMT 2022
    - 2.5K bytes
    - Viewed (0)
  9. okhttp-testing-support/src/main/kotlin/okhttp3/DelegatingSSLSocket.kt

      }
    
      override fun isBound(): Boolean {
        return delegate!!.isBound
      }
    
      override fun isConnected(): Boolean {
        return delegate!!.isConnected
      }
    
      override fun isClosed(): Boolean {
        return delegate!!.isClosed
      }
    
      @Throws(IOException::class)
      override fun bind(localAddr: SocketAddress) {
        delegate!!.bind(localAddr)
      }
    
      @Throws(IOException::class)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 7.9K bytes
    - Viewed (0)
  10. okhttp/src/main/kotlin/okhttp3/internal/connection/RealConnection.kt

        lock.assertNotHeld()
    
        val nowNs = System.nanoTime()
    
        val rawSocket = this.rawSocket!!
        val socket = this.socket!!
        val source = this.source!!
        if (rawSocket.isClosed || socket.isClosed || socket.isInputShutdown ||
          socket.isOutputShutdown
        ) {
          return false
        }
    
        val http2Connection = this.http2Connection
        if (http2Connection != null) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 15.4K bytes
    - Viewed (0)
Back to top