@@ -67,30 +67,33 @@ def test_file_path(self) -> None:
67
67
def test_artifact_type (self ) -> None :
68
68
self .assertNotEqual (ValidationArgs ().artifact_type , "production" )
69
69
70
- @patch ("argparse._sys.argv" , [VALIDATION_PY , "--version" , "1.3.6" , "--distribution" , "rpm" , "--artifact-type" , "staging" , "--os-build-number" , "1234" , "--osd-build-number" , "2312" , "--force-https" ]) # noqa: E501
71
- def test_force_https (self ) -> None :
72
- self .assertEqual (ValidationArgs ().force_https , False )
70
+ @patch ("argparse._sys.argv" , [VALIDATION_PY , "--version" , "1.3.6" , "--distribution" , "rpm" , "--artifact-type" , "staging" ,
71
+ "--os-build-number" , "1234" , "--osd-build-number" , "2312" , "--allow-http" ])
72
+ def test_allow_http (self ) -> None :
73
+ self .assertEqual (ValidationArgs ().allow_http , True )
73
74
74
75
@patch ("argparse._sys.argv" , [VALIDATION_PY , "--version" , "1.3.6" , "--distribution" , "rpm" , "--artifact-type" , "staging" , "--os-build-number" , "1234" , "--osd-build-number" , "2312" ])
75
- def test_without_force_https (self ) -> None :
76
- self .assertEqual (ValidationArgs ().force_https , True )
76
+ def test_do_not_allow_http (self ) -> None :
77
+ self .assertEqual (ValidationArgs ().allow_http , False )
77
78
78
79
@patch ("argparse._sys.argv" , [VALIDATION_PY , "--version" , "1.3.0" , "--projects" , "opensearch" ])
79
80
def test_set_projects (self ) -> None :
80
81
self .assertEqual (ValidationArgs ().projects , ["opensearch" ])
81
82
82
- @patch ('sys.argv' , [VALIDATION_PY , "--file-path" , "opensearch=https://opensearch.org/releases/opensearch/2.8.0/opensearch-2.8.0-linux-x64.rpm" , "opensearch-dashboard=https://opensearch.org/releases/opensearch/2.8.0/opensearch-dashboards-2.8.0-linux-x64.rpm" ]) # noqa: E501
83
+ @patch ('sys.argv' , [VALIDATION_PY , "--file-path" , "opensearch=https://opensearch.org/releases/opensearch/2.8.0/opensearch-2.8.0-linux-x64.rpm" ,
84
+ "opensearch-dashboard=https://opensearch.org/releases/opensearch/2.8.0/opensearch-dashboards-2.8.0-linux-x64.rpm" ])
83
85
def test_dashboards_exception (self ) -> None :
84
86
with self .assertRaises (Exception ) as ctx :
85
87
self .assertEqual (ValidationArgs ().distribution , "rpm" )
86
88
self .assertEqual (str (ctx .exception ), "Missing OpenSearch artifact details! Please provide the valid product names among opensearch and opensearch-dashboards" )
87
89
88
- @patch ("argparse._sys.argv" , [VALIDATION_PY , "--version" , "2.4.0" , "--distribution" , "docker" , "--os-build-number" , "1234" , "--osd-build-number" , "8393" , "--projects" , "opensearch" , "--using-staging-artifact-only" ]) # noqa: E501
90
+ @patch ("argparse._sys.argv" , [VALIDATION_PY , "--version" , "2.4.0" , "--distribution" , "docker" , "--os-build-number" , "1234" ,
91
+ "--osd-build-number" , "8393" , "--projects" , "opensearch" , "--using-staging-artifact-only" ])
89
92
def test_docker_exception (self ) -> None :
90
93
with self .assertRaises (Exception ) as ctx :
91
94
self .assertEqual (ValidationArgs ().projects , ["opensearch" ])
92
95
self .assertEqual (ValidationArgs ().osd_build_number , "1234" )
93
- self .assertEqual (str (ctx .exception ), "Provide opensearch-dashboards in projects argument to validate OpenSearch-Dashboards " )
96
+ self .assertEqual (str (ctx .exception ), "osd_build_number argument cannot be provided without specifying opensearch-dashboards in --projects " )
94
97
95
98
@patch ("argparse._sys.argv" , [VALIDATION_PY , "--version" , "2.4.0" , "--distribution" , "docker" , "--os-build-number" , "1234" , "--projects" , "opensearch" ])
96
99
def test_docker_arguments_exception (self ) -> None :
0 commit comments