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