Пример #1
0
 def test_revert(self):
     """
     revert - test to ensure that ``revert`` method functions
     without exception
     """
     sartoris_obj = Sartoris()
     try:
         sartoris_obj.revert(namedtuple('o', 'force')(False))
     except SartorisError:
         assert False
Пример #2
0
 def test_start(self):
     """
     start - test to ensure that ``start`` method functions
     without exception
     """
     sartoris_obj = Sartoris()
     try:
         sartoris_obj.start(None)
     except SartorisError:
         assert False
Пример #3
0
 def test_log_deploys(self):
     """
     log_deploys - test to ensure that ``log_deploys`` method functions
     without exception
     """
     sartoris_obj = Sartoris()
     try:
         sartoris_obj.log_deploys(namedtuple('o', 'count')(1))
     except SartorisError:
         assert False
Пример #4
0
 def test_diff(self):
     """
     diff - test to ensure that ``diff`` method functions
     without exception
     """
     sartoris_obj = Sartoris()
     try:
         sartoris_obj.diff(None)
     except SartorisError:
         assert False
Пример #5
0
 def test_resync(self):
     """
     resync - test to ensure that ``resync`` method functions
     without exception
     """
     sartoris_obj = Sartoris()
     try:
         sartoris_obj.resync(None)
     except SartorisError:
         assert False
Пример #6
0
 def test_log_deploys(self):
     """
     log_deploys - test to ensure that ``log_deploys`` method functions
     without exception
     """
     sartoris_obj = Sartoris()
     try:
         sartoris_obj.log_deploys(None)
     except SartorisError:
         assert False
Пример #7
0
    def test_dulwich_tag(self):
        """
        Tests method Sartoris::_dulwich_tag

            1. Call _dulwich_tag
            2. Check most recent tag to verify tag exists
        """
        s = Sartoris()
        tag = 'test_tag'
        s._dulwich_tag(tag, s._make_author())
        tags = s._dulwich_get_tags()
        assert tags.keys()[0] == tag
Пример #8
0
    def test_sync(self):
        """
        sync - test to ensure that ``sync`` method functions
        without exception
        """
        sartoris_obj = Sartoris()
        try:
            sartoris_obj.start(None)
            sartoris_obj.sync(None)

            # TODO - check tag and deploy file
        except SartorisError:
            assert False
Пример #9
0
    def test_abort(self):
        """
        abort - test to ensure that ``abort`` method functions
        without exception
        """
        sartoris_obj = Sartoris()

        try:
            sartoris_obj.start(None)
            sartoris_obj.abort(None)

            # TODO - check lock file & commit

        except SartorisError:
            assert False
Пример #10
0
    def test_deploy_in_progress(self):
        """
        deploy_in_progress - test to ensure that when the ``start`` method
        is called when a deployment is in progress Sartoris exits with error
        """
        sartoris_obj = Sartoris()

        # TODO - ensure that the repo is "fresh"

        # Call ``start`` twice
        try:
            sartoris_obj.start(None)
            sartoris_obj.start(None)
        except SartorisError as e:
            if not e.msg == exit_codes[2]:
                assert False
            return
        assert False
Пример #11
0
    def test_show_tag(self):
        """
        start - test to ensure that start method functions
        without exception
        """
        sartoris_obj = Sartoris()
        try:
            sartoris_obj.start(None)
            sartoris_obj.sync(None)
            sartoris_obj.show_tag(None)

        except SartorisError:
            assert False