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

All Samples(11)  |  Call(9)  |  Derive(0)  |  Import(2)

src/f/a/faitout-HEAD/tests/test_faitoutlib.py   faitout(Download)
from faitout import faitoutlib
from faitout.faitoutlib import model
from tests import Modeltests, create_connections
 
 
    def test_get_stats(self):
        """ Test the get_stats method of faitoutlib. """
        create_connections(self.session)
 
        output = faitoutlib.get_stats(self.session)
    def test_get_new_connection(self):
        """ Test the get_new_connection method of faitoutlib. """
        create_connections(self.session)
 
        faitoutlib.create_database = mock.MagicMock()
    def test_clean_connection(self):
        """ Test the clean_connection method of faitoutlib. """
        create_connections(self.session)
 
        faitoutlib.clean_database = mock.MagicMock()
    def test_drop_connection(self):
        """ Test the drop_connection method of faitoutlib. """
        create_connections(self.session)
 
        faitoutlib.drop_database = mock.MagicMock()

src/f/a/faitout-HEAD/tests/test_model.py   faitout(Download)
 
from faitout.faitoutlib import model
from tests import Modeltests, create_connections
 
 
    def test_search(self):
        """ Test the search method of Connection. """
        create_connections(self.session)
 
        connections = model.Connection.search(self.session, active=True)
    def test_cnt_unique_ip(self):
        """ Test the cnt_unique_ip method of Connection. """
        create_connections(self.session)
 
        unique_ip = model.Connection.cnt_unique_ip(self.session)
        self.assertEqual(unique_ip, 2)
 
    def test_by_ip(self):
        """ Test the by_ip method of Connection. """
        create_connections(self.session)
    def test_by_db_name(self):
        """ Test the by_db_name method of Connection. """
        create_connections(self.session)
 
        connection = model.Connection.by_db_name(self.session, 'db2')