@@ -742,6 +742,43 @@ func TestDatabasePoolCreate(t *testing.T) {
742742 })
743743}
744744
745+ func TestDatabasePoolCreate_InboundUser (t * testing.T ) {
746+ pool := * (testDBPool .DatabasePool )
747+ pool .Connection = nil
748+
749+ r := & godo.DatabaseCreatePoolRequest {
750+ Name : pool .Name ,
751+ Mode : pool .Mode ,
752+ Size : pool .Size ,
753+ Database : pool .Database ,
754+ }
755+
756+ // Successful call
757+ withTestClient (t , func (config * CmdConfig , tm * tcMocks ) {
758+ tm .databases .EXPECT ().CreatePool (testDBCluster .ID , r ).Return (& testDBPool , nil )
759+
760+ config .Args = append (config .Args , testDBCluster .ID , testDBPool .Name )
761+ config .Doit .Set (config .NS , doctl .ArgDatabasePoolDBName , testDB .Name )
762+ config .Doit .Set (config .NS , doctl .ArgDatabasePoolMode , testDBPool .Mode )
763+ config .Doit .Set (config .NS , doctl .ArgDatabasePoolSize , testDBPool .Size )
764+
765+ err := RunDatabasePoolCreate (config )
766+ assert .NoError (t , err )
767+ })
768+
769+ // Error
770+ withTestClient (t , func (config * CmdConfig , tm * tcMocks ) {
771+ tm .databases .EXPECT ().CreatePool (
772+ testDBCluster .ID ,
773+ gomock .AssignableToTypeOf (& godo.DatabaseCreatePoolRequest {}),
774+ ).Return (nil , errTest )
775+
776+ config .Args = append (config .Args , testDBCluster .ID , testDBPool .Name )
777+ err := RunDatabasePoolCreate (config )
778+ assert .EqualError (t , err , "error" )
779+ })
780+ }
781+
745782func TestDatabasesPoolDelete (t * testing.T ) {
746783 // Successful
747784 withTestClient (t , func (config * CmdConfig , tm * tcMocks ) {
0 commit comments