@@ -11,7 +11,6 @@ export ARTIFACTORY_ACCESS_TOKEN="test-token"
1111
1212# Expected output messages
1313MESSAGE_CONFIGURING_PIP=" Configuring pip to use Artifactory..."
14- MESSAGE_PIP_CONFIGURATION_SUCCESS=" ✓ pip configuration completed successfully"
1514MESSAGE_REPOX_HOST=" Repox host: repox.jfrog.io/artifactory"
1615
1716Describe ' config-pip/config.sh'
@@ -45,13 +44,12 @@ Describe 'configure_pip()'
4544 It ' creates pip config directory, file and correct content'
4645 When call configure_pip
4746 The status should be success
48- The lines of output should equal 4
47+ The lines of output should equal 3
4948 The lines of error should equal 0
5049 The line 1 should equal " $MESSAGE_CONFIGURING_PIP "
5150 The line 2 should equal " $MESSAGE_REPOX_HOST "
52- The line 3 should equal " $MESSAGE_PIP_CONFIGURATION_SUCCESS "
53- The line 4 should start with " Configuration file: "
54- The line 4 should end with " /.pip/pip.conf"
51+ The line 3 should start with " Configuration file: "
52+ The line 3 should end with " /.pip/pip.conf"
5553 The path " ${HOME} /.pip" should be directory
5654 The path " ${HOME} /.pip/pip.conf" should be file
5755 The contents of file " ${HOME} /.pip/pip.conf" should equal " [global]
@@ -62,47 +60,17 @@ index-url = https://test-user:
[email protected] /artifactory/api/pypi/son
6260 export ARTIFACTORY_URL=" https://repox.jfrog.io:8080/artifactory"
6361 When call configure_pip
6462 The status should be success
65- The lines of output should equal 4
63+ The lines of output should equal 3
6664 The lines of error should equal 0
6765 The line 1 should equal " $MESSAGE_CONFIGURING_PIP "
6866 The line 2 should equal " Repox host: repox.jfrog.io:8080/artifactory"
69- The line 3 should equal " $MESSAGE_PIP_CONFIGURATION_SUCCESS "
70- The line 4 should start with " Configuration file: "
71- The line 4 should end with " /.pip/pip.conf"
67+ The line 3 should start with " Configuration file: "
68+ The line 3 should end with " /.pip/pip.conf"
7269 The contents of file " ${HOME} /.pip/pip.conf" should equal " [global]
7370index-url = https://test-user:[email protected] :8080/artifactory/api/pypi/sonarsource-pypi/simple" 7471 End
7572End
7673
77- Describe ' Environment variable validation'
78- It ' fails when ARTIFACTORY_URL is not set'
79- unset ARTIFACTORY_URL
80- When run script config-pip/config.sh
81- The status should be failure
82- The lines of output should equal 0
83- The lines of error should equal 1
84- The error should equal " ERROR: ARTIFACTORY_URL is required"
85- End
86-
87- It ' fails when ARTIFACTORY_USERNAME is not set'
88- unset ARTIFACTORY_USERNAME
89- When run script config-pip/config.sh
90- The status should be failure
91- The lines of output should equal 0
92- The lines of error should equal 1
93- The error should equal " ERROR: ARTIFACTORY_USERNAME is required"
94- End
95-
96- It ' fails when ARTIFACTORY_ACCESS_TOKEN is not set'
97- unset ARTIFACTORY_ACCESS_TOKEN
98- When run script config-pip/config.sh
99- The status should be failure
100- The lines of output should equal 0
101- The lines of error should equal 1
102- The error should equal " ERROR: ARTIFACTORY_ACCESS_TOKEN is required"
103- End
104- End
105-
10674Describe ' main()'
10775 BeforeEach ' common_setup'
10876 AfterEach ' common_cleanup'
@@ -112,15 +80,14 @@ Describe 'main()'
11280 export ARTIFACTORY_ACCESS_TOKEN=" my-secret-token"
11381 When run script config-pip/config.sh
11482 The status should be success
115- The lines of output should equal 6
83+ The lines of output should equal 5
11684 The lines of error should equal 0
11785 The line 1 should equal " ::group::Configure pip"
11886 The line 2 should equal " $MESSAGE_CONFIGURING_PIP "
11987 The line 3 should equal " $MESSAGE_REPOX_HOST "
120- The line 4 should equal " $MESSAGE_PIP_CONFIGURATION_SUCCESS "
121- The line 5 should start with " Configuration file: "
122- The line 5 should end with " /.pip/pip.conf"
123- The line 6 should equal " ::endgroup::"
88+ The line 4 should start with " Configuration file: "
89+ The line 4 should end with " /.pip/pip.conf"
90+ The line 5 should equal " ::endgroup::"
12491 The path " ${HOME} /.pip/pip.conf" should be file
12592 The contents of file " ${HOME} /.pip/pip.conf" should equal " [global]
12693index-url = https://my-user:[email protected] /artifactory/api/pypi/sonarsource-pypi/simple"
0 commit comments