Esempio n. 1
0
 def test_validate_site_missing_rev(self):
     """Test the function that runs the validator class with a
     deployment strategy that has a cycle in the groups
     """
     with pytest.raises(ApiError) as apie:
         validate_site_action({'id': '123', 'name': 'deploy_site'})
     assert apie.value.description == 'InvalidDocumentRevision'
Esempio n. 2
0
 def test_validate_site_action(self, *args):
     """Test the function that runs the validator class"""
     try:
         validate_site_action({
             'id': '123',
             'name': 'deploy_site',
             'committed_rev_id': 1
         })
     except Exception as ex:
         # any exception is a failure
         assert False, str(ex)
Esempio n. 3
0
 def test_validate_site_action_missing_dep_strat(self, *args):
     """Test the function that runs the validator class with a missing
     deployment strategy - specified, but not present
     """
     with pytest.raises(ApiError) as apie:
         validate_site_action({
             'id': '123',
             'name': 'deploy_site',
             'committed_rev_id': 1
         })
     assert apie.value.description == 'InvalidConfigurationDocuments'
     assert apie.value.error_list[0]['name'] == 'DocumentNotFoundError'
Esempio n. 4
0
 def test_validate_site_action_cycle(self, *args):
     """Test the function that runs the validator class with a
     deployment strategy that has a cycle in the groups
     """
     with pytest.raises(ApiError) as apie:
         validate_site_action({
             'id': '123',
             'name': 'deploy_site',
             'committed_rev_id': 1
         })
     assert apie.value.description == 'InvalidConfigurationDocuments'
     assert ('The following are involved in a circular dependency:'
             ) in apie.value.error_list[0]['diagnostic']
Esempio n. 5
0
 def test_validate_site_action_default_dep_strat(self, *args):
     """Test the function that runs the validator class with a defaulted
     deployment strategy (not specified)
     """
     try:
         validate_site_action({
             'id': '123',
             'name': 'deploy_site',
             'committed_rev_id': 1
         })
     except:
         # any exception is a failure
         assert False
Esempio n. 6
0
 def test_validate_site_action_continue_failure(self, *args):
     """Test the function that runs the validator class with a defaulted
     deployment strategy (not specified)
     """
     try:
         validate_site_action({
             'id': '123',
             'name': 'deploy_site',
             'committed_rev_id': 1,
             'parameters': {
                 'continue-on-fail': 'true'
             }
         })
     except:
         # any exception is a failure
         assert False