Example #1
0
 def test_artifact_get_metadata(self):
     with patch(
             "salt.modules.artifactory._get_artifact_metadata_xml",
             MagicMock(
                 return_value="""<?xml version="1.0" encoding="UTF-8"?>
             <metadata>
               <groupId>com.company.sampleapp.web-module</groupId>
               <artifactId>web</artifactId>
               <versioning>
                 <latest>1.1_RC11</latest>
                 <release>1.0.1</release>
                 <versions>
                   <version>1.0_RC20</version>
                   <version>1.0_RC22</version>
                 </versions>
                 <lastUpdated>20140623120632</lastUpdated>
               </versioning>
             </metadata>
         """),
     ):
         metadata = artifactory._get_artifact_metadata(
             artifactory_url="http://artifactory.example.com/artifactory",
             repository="libs-releases",
             group_id="com.company.sampleapp.web-module",
             artifact_id="web",
             headers={},
         )
         self.assertEqual(metadata["latest_version"], "1.1_RC11")
Example #2
0
 def test_artifact_get_metadata(self):
     with patch(
             'salt.modules.artifactory._get_artifact_metadata_xml',
             MagicMock(
                 return_value='''<?xml version="1.0" encoding="UTF-8"?>
             <metadata>
               <groupId>com.company.sampleapp.web-module</groupId>
               <artifactId>web</artifactId>
               <versioning>
                 <latest>1.1_RC11</latest>
                 <release>1.0.1</release>
                 <versions>
                   <version>1.0_RC20</version>
                   <version>1.0_RC22</version>
                 </versions>
                 <lastUpdated>20140623120632</lastUpdated>
               </versioning>
             </metadata>
         ''')):
         metadata = artifactory._get_artifact_metadata(
             artifactory_url='http://artifactory.example.com/artifactory',
             repository='libs-releases',
             group_id='com.company.sampleapp.web-module',
             artifact_id='web',
             headers={})
         self.assertEqual(metadata['latest_version'], '1.1_RC11')
Example #3
0
 def test_artifact_get_metadata(self):
     artifactory._get_artifact_metadata_xml = MagicMock(
         return_value="""<?xml version="1.0" encoding="UTF-8"?>
         <metadata>
           <groupId>com.company.sampleapp.web-module</groupId>
           <artifactId>web</artifactId>
           <versioning>
             <latest>1.1_RC11</latest>
             <release>1.0.1</release>
             <versions>
               <version>1.0_RC20</version>
               <version>1.0_RC22</version>
             </versions>
             <lastUpdated>20140623120632</lastUpdated>
           </versioning>
         </metadata>
     """
     )
     metadata = artifactory._get_artifact_metadata(
         artifactory_url="http://artifactory.company.com/artifactory",
         repository="libs-releases",
         group_id="com.company.sampleapp.web-module",
         artifact_id="web",
         headers={},
     )
     self.assertEqual(metadata["latest_version"], "1.1_RC11")
Example #4
0
 def test_artifact_get_metadata(self):
     artifactory._get_artifact_metadata_xml = MagicMock(return_value='''<?xml version="1.0" encoding="UTF-8"?>
         <metadata>
           <groupId>com.company.sampleapp.web-module</groupId>
           <artifactId>web</artifactId>
           <versioning>
             <latest>1.1_RC11</latest>
             <release>1.0.1</release>
             <versions>
               <version>1.0_RC20</version>
               <version>1.0_RC22</version>
             </versions>
             <lastUpdated>20140623120632</lastUpdated>
           </versioning>
         </metadata>
     ''')
     metadata = artifactory._get_artifact_metadata(artifactory_url='http://artifactory.example.com/artifactory',
                                         repository='libs-releases',
                                         group_id='com.company.sampleapp.web-module',
                                         artifact_id='web',
                                         headers={})
     self.assertEqual(metadata['latest_version'], '1.1_RC11')