clusters_test.go | |
---|---|
|
|
Documentation in literate-programming-style is available at: https://redhatinsights.github.io/insights-operator-cli/packages/commands/clusters_test.html |
|
checkCapturedOutput function checks if the capturing of standard output was correct. |
|
tryToFindCluster helper function checks if captured standard output contains provided cluster name or not. |
|
TestListOfClusters function checks whether the non-empty list of clusters read via REST API is displayed correctly |
|
turn off any colorization on standard output |
|
use mocked REST API instead of the real one |
|
use go-capture package to capture all writes to standard output |
|
check if capture operation was finished correctly |
|
check if header was written into standard output |
|
check if list of clusters was written onto standard output |
|
TestListOfClustersNoClusters function checks whether the empty list of clusters read via REST API is displayed correctly |
|
turn off any colorization on standard output |
|
use mocked REST API instead of the real one |
|
use go-capture package to capture all writes to standard output |
|
check if capture operation was finished correctly |
|
check if header was written into standard output |
|
check if list of clusters was written onto standard output |
|
TestListOfClusters function checks whether error returned by REST API is handled correctly |
|
turn off any colorization on standard output |
|
use mocked REST API instead of the real one |
|
use go-capture package to capture all writes to standard output |
|
check if capture operation was finished correctly |
|
check if error message was written into standard output |
|
TestAddCluster function checks the command 'add cluster' |
|
turn off any colorization on standard output |
|
use mocked REST API instead of the real one |
|
use go-capture package to capture all writes to standard output |
|
check if capture operation was finished correctly |
|
check if cluster has been added via mocked REST API |
|
TestAddClusterError checks the command 'add cluster' when error is reported by REST API |
|
turn off any colorization on standard output |
|
use mocked REST API instead of the real one |
|
use go-capture package to capture all writes to standard output |
|
check if capture operation was finished correctly |
|
check if error message was written into standard output as expected |
|
TestDeleteCluster checks the command 'delete cluster' |
|
turn off any colorization on standard output |
|
use go-capture package to capture all writes to standard output |
|
check if capture operation was finished correctly |
|
check if cluster has been deleted via mocked REST API |
|
TestDeleteClusterError checks the command 'delete cluster' when error is reported by REST API |
|
turn off any colorization on standard output |
|
use go-capture package to capture all writes to standard output |
|
check if capture operation was finished correctly |
|
check if error message was written into standard output as expected |
|
TestDeleteClusterNoConfirm checks the command 'delete cluster' w/o confirmation of the command |
|
turn off any colorization on standard output |
|
use go-capture package to capture all writes to standard output |
|
check if capture operation was finished correctly |
|
check if cluster has been deleted via mocked REST API |
|
TestDeleteClusterNoConfirmError checks the command 'delete cluster' when error is reported by REST API |
|
turn off any colorization on standard output |
|
use go-capture package to capture all writes to standard output |
|
check if capture operation was finished correctly |
|
check if error message was written into standard output as expected |
|