Exemplo n.º 1
0
    def test_get_default_port_unsupported(self):
        ''' Raise an exception if the database type is not supported. '''

        type_ = 'bogusdb'

        with self.assertRaises(ValueError):
            agnostic._get_default_port(type_)
Exemplo n.º 2
0
    def test_get_default_port(self):
        ''' Get the default port number for a given type of database. '''

        type_ = 'postgres'

        port = agnostic._get_default_port(type_)

        self.assertIsInstance(port, int)