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

All Samples(36)  |  Call(30)  |  Derive(0)  |  Import(6)

src/p/y/pyroonga-0.5.2/pyroonga/tests/unit/test_groonga.py   pyroonga(Download)
 
from pyroonga.exceptions import GroongaError, error_messages
from pyroonga.groonga import Groonga
 
from pyroonga.tests import utils, mock
    def test___init__with_encoding(self, encoding):
        grn = Groonga(encoding=encoding)
        assert grn.host == '0.0.0.0'
        assert grn.port == 10041
        assert grn.encoding == encoding
        assert grn.connected is False
 
    def test___init___with_default_params(self):
        grn = Groonga()
    def test___init___with_params(self):
        host = utils.random_string()
        port = random.randint(0, 65535)
        encoding = random.choice(['euc-jp', 'sjis', 'latin1', 'koi8-r'])
        grn = Groonga(host=host, port=port, encoding=encoding)
    def test_connect_with_default(self):
        grn = Groonga()
        grn._ctx = mock.MagicMock()
        grn._ctx.connect.return_value = 0
        assert grn.connected is False

src/p/y/pyroonga-HEAD/pyroonga/tests/unit/test_groonga.py   pyroonga(Download)
 
from pyroonga.exceptions import GroongaError, error_messages
from pyroonga.groonga import Groonga
 
from pyroonga.tests import utils, mock
    def test___init__with_encoding(self, encoding):
        grn = Groonga(encoding=encoding)
        assert grn.host == '0.0.0.0'
        assert grn.port == 10041
        assert grn.encoding == encoding
        assert grn.connected is False
 
    def test___init___with_default_params(self):
        grn = Groonga()
    def test___init___with_params(self):
        host = utils.random_string()
        port = random.randint(0, 65535)
        encoding = random.choice(['euc-jp', 'sjis', 'latin1', 'koi8-r'])
        grn = Groonga(host=host, port=port, encoding=encoding)
    def test_connect_with_default(self):
        grn = Groonga()
        grn._ctx = mock.MagicMock()
        grn._ctx.connect.return_value = 0
        assert grn.connected is False

src/p/y/pyroonga-0.5.2/pyroonga/odm/table.py   pyroonga(Download)
import logging
 
from pyroonga.groonga import Groonga
from pyroonga.odm.attributes import (
    TableFlags,

src/p/y/pyroonga-HEAD/pyroonga/odm/table.py   pyroonga(Download)
import logging
 
from pyroonga.groonga import Groonga
from pyroonga.odm.attributes import (
    TableFlags,

src/p/y/pyroonga-HEAD/pyroonga/tests/functional/test_groonga.py   pyroonga(Download)
 
from pyroonga.exceptions import GroongaError
from pyroonga.groonga import Groonga
 
 
    def test_connect_with_incorrect_params(self, host, port):
        grn = Groonga()
        with pytest.raises(GroongaError):
            grn.connect(host=host, port=port)
 
    def test_connect_with_default(self):
        grn = Groonga()
    def test_connect_with_params(self):
        grn = Groonga()
        assert grn.connected is False
        assert grn.host == '0.0.0.0'
        assert grn.port == 10041
    def test_reconnect(self):
        grn = Groonga()
        ctx = grn._ctx
        assert grn._ctx is ctx
        assert grn.connected is False

src/p/y/pyroonga-0.5.2/pyroonga/tests/functional/test_groonga.py   pyroonga(Download)
 
from pyroonga.exceptions import GroongaError
from pyroonga.groonga import Groonga
 
 
    def test_connect_with_incorrect_params(self, host, port):
        grn = Groonga()
        with pytest.raises(GroongaError):
            grn.connect(host=host, port=port)
 
    def test_connect_with_default(self):
        grn = Groonga()
    def test_connect_with_params(self):
        grn = Groonga()
        assert grn.connected is False
        assert grn.host == '0.0.0.0'
        assert grn.port == 10041
    def test_reconnect(self):
        grn = Groonga()
        ctx = grn._ctx
        assert grn._ctx is ctx
        assert grn.connected is False