def test_tubes(c: Client) -> None: assert c.tubes() == ["default"] c.use("a") assert set(c.tubes()) == {"default", "a"} c.watch("b") c.watch("c") assert set(c.tubes()) == {"default", "a", "b", "c"}
def test_tubes(c: Client) -> None: assert c.tubes() == ['default'] c.use('a') assert set(c.tubes()) == {'default', 'a'} c.watch('b') c.watch('c') assert set(c.tubes()) == {'default', 'a', 'b', 'c'}
def test_basic_usage(c: Client) -> None: c.use("emails") id = c.put("测试@example.com".encode("utf-8")) c.watch("emails") c.ignore("default") job = c.reserve() assert id == job.id assert job.body.decode("utf-8") == "测试@example.com" c.delete(job)
def test_initialize_with_tubes(c: Client) -> None: c.put(b"www.example.com") job = c.reserve() assert job.body == b"www.example.com" c.delete(job.id) c.use("default") c.put(b"") with pytest.raises(TimedOutError): c.reserve(timeout=0)
def test_basic_usage(c: Client) -> None: c.use('emails') id = c.put('测试@example.com') c.watch('emails') c.ignore('default') job = c.reserve() assert id == job.id assert job.body == '测试@example.com' c.delete(job)
def test_initialize_with_tubes(c: Client) -> None: c.put('www.example.com') job = c.reserve() assert job.body == 'www.example.com' c.delete(job.id) c.use('default') c.put('') with pytest.raises(TimedOutError): c.reserve(timeout=0)
def test_initialize_watch_multiple(c: Client) -> None: c.use("static") c.put(b"haskell") c.put(b"rust") c.use("dynamic") c.put(b"python") job = c.reserve(timeout=0) assert job.body == b"haskell" job = c.reserve(timeout=0) assert job.body == b"rust" job = c.reserve(timeout=0) assert job.body == b"python"
def test_initialize_watch_multiple(c: Client) -> None: c.use('static') c.put(b'haskell') c.put(b'rust') c.use('dynamic') c.put(b'python') job = c.reserve(timeout=0) assert job.body == 'haskell' job = c.reserve(timeout=0) assert job.body == 'rust' job = c.reserve(timeout=0) assert job.body == 'python'
def test_using(c: Client) -> None: assert c.using() == "default" c.use("another") assert c.using() == "another"
def test_using(c: Client) -> None: assert c.using() == 'default' c.use('another') assert c.using() == 'another'