Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(17)  |  Call(16)  |  Derive(0)  |  Import(1)

src/p/y/pyroonga-HEAD/pyroonga/tests/unit/test___init__.py   pyroonga(Download)
def test_connect_with_default():
    with mock.patch('pyroonga.groonga.Context') as m:
        m.return_value.connect.return_value = 0
        grn = pyroonga.connect()
        assert isinstance(grn, pyroonga.Groonga)
    with mock.patch('pyroonga.groonga.Context') as m:
        m.return_value.connect.return_value = 0
        grn = pyroonga.connect(host, port)
        assert isinstance(grn, pyroonga.Groonga)
        assert grn.host == host
def test_import():
    from pyroonga import (
        connect,
        Groonga,
        GroongaError,

src/p/y/pyroonga-HEAD/pyroonga/tests/functional/__init__.py   pyroonga(Download)
    def test_connect_with_default(self):
        grn = pyroonga.connect()
        assert grn.connected is True
        assert grn.host == '0.0.0.0'
        assert grn.port == 10041
 
    def test_connect_with_params(self):
        grn = pyroonga.connect(host='localhost', port=10041)
    def test_connect_with_invalid_params(self, host, port):
        with pytest.raises(pyroonga.GroongaError):
            pyroonga.connect(host=host, port=port)
 

src/p/y/pyroonga-0.5.2/pyroonga/tests/functional/__init__.py   pyroonga(Download)
    def test_connect_with_default(self):
        grn = pyroonga.connect()
        assert grn.connected is True
        assert grn.host == '0.0.0.0'
        assert grn.port == 10041
 
    def test_connect_with_params(self):
        grn = pyroonga.connect(host='localhost', port=10041)
    def test_connect_with_invalid_params(self, host, port):
        with pytest.raises(pyroonga.GroongaError):
            pyroonga.connect(host=host, port=port)
 

src/p/y/pyroonga-HEAD/pyroonga/tests/functional/test___init__.py   pyroonga(Download)
def test_connect_with_default():
    grn = pyroonga.connect()
    assert isinstance(grn, pyroonga.Groonga)
    assert grn.host == '0.0.0.0'
    assert grn.port == 10041
    assert grn.connected is True
 
 
def test_connect():
    grn = pyroonga.connect('localhost', 10041)
def test_connect_with_incorrect_params(host, port):
    with pytest.raises(pyroonga.GroongaError):
        pyroonga.connect(host, port)
 

src/p/y/pyroonga-0.5.2/pyroonga/tests/functional/test___init__.py   pyroonga(Download)
def test_connect_with_default():
    grn = pyroonga.connect()
    assert isinstance(grn, pyroonga.Groonga)
    assert grn.host == '0.0.0.0'
    assert grn.port == 10041
    assert grn.connected is True
 
 
def test_connect():
    grn = pyroonga.connect('localhost', 10041)
def test_connect_with_incorrect_params(host, port):
    with pytest.raises(pyroonga.GroongaError):
        pyroonga.connect(host, port)
 

src/p/y/pyroonga-0.5.2/pyroonga/tests/unit/test___init__.py   pyroonga(Download)
def test_connect_with_default():
    with mock.patch('pyroonga.groonga.Context') as m:
        m.return_value.connect.return_value = 0
        grn = pyroonga.connect()
        assert isinstance(grn, pyroonga.Groonga)
    with mock.patch('pyroonga.groonga.Context') as m:
        m.return_value.connect.return_value = 0
        grn = pyroonga.connect(host, port)
        assert isinstance(grn, pyroonga.Groonga)
        assert grn.host == host