Beispiel #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_)
Beispiel #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)