Example #1
0
    def test_docker_push(self):
        """test plain docker push"""
        self.opts.tag = None
        self.opts.latest = False
        dckr.docker_push(self.opts, self.config)

        self.mock_subp.check_output.assert_has_calls([
            mock.call(['docker', 'push', 'unittesting/unittesting:1.2.3']),
        ])
Example #2
0
    def test_docker_push(self):
        """test plain docker push"""
        self.opts.tag = None
        self.opts.latest = False
        dckr.docker_push(self.opts, self.config)

        self.mock_check_output.assert_has_calls(
            [
                mock.call(['docker', 'push', 'unittesting/unittesting:1.2.3']),
            ]
        )
Example #3
0
 def test_docker_push_login(self):
     """test push with login"""
     self.opts.login = True
     self.opts.tag = None
     self.config['docker']['docker_login_username'] = '******'
     self.config['docker']['docker_login_password'] = '******'
     self.config['docker']['docker_login_email'] = '*****@*****.**'
     self.config['docker']['docker_repo'] = None
     dckr.docker_push(self.opts, self.config)
     self.mock_subp.check_output.assert_has_calls(
         [mock.call(['docker', 'push', 'unittesting/unittesting:1.2.3'])])
Example #4
0
 def test_docker_push_login(self):
     """test push with login"""
     self.opts.login = True
     self.opts.tag = None
     self.config['docker']['docker_login_username'] = '******'
     self.config['docker']['docker_login_password'] = '******'
     self.config['docker']['docker_login_email'] = '*****@*****.**'
     self.config['docker']['docker_repo'] = None
     dckr.docker_push(self.opts, self.config)
     self.mock_check_output.assert_has_calls(
         [
             mock.call(['docker', 'push', 'unittesting/unittesting:1.2.3'])
         ]
     )
Example #5
0
 def test_docker_push_addl(self):
     """test docker push with additional tags"""
     self.opts.tag = None
     self.opts.latest = True
     self.config['docker']['additional_repos'] = "repo1:8080, repo2:8080"
     dckr.docker_push(self.opts, self.config)
     self.mock_subp.check_output.assert_has_calls([
         mock.call(['docker', 'push', 'unittesting/unittesting:1.2.3']),
         mock.call(['docker', 'push', 'unittesting/unittesting:latest']),
         mock.call(['docker', 'push', 'repo1:8080/unittesting:1.2.3']),
         mock.call(['docker', 'push', 'repo1:8080/unittesting:latest']),
         mock.call(['docker', 'push', 'repo2:8080/unittesting:1.2.3']),
         mock.call(['docker', 'push', 'repo2:8080/unittesting:latest'])
     ])
Example #6
0
 def test_docker_push_addl(self):
     """test docker push with additional tags"""
     self.opts.tag = None
     self.opts.latest = True
     self.config['docker']['additional_repos'] = "repo1:8080, repo2:8080"
     dckr.docker_push(self.opts, self.config)
     self.mock_check_output.assert_has_calls(
         [
             mock.call(['docker', 'push', 'unittesting/unittesting:1.2.3']),
             mock.call(['docker', 'push', 'unittesting/unittesting:latest']),
             mock.call(['docker', 'push', 'repo1:8080/unittesting:1.2.3']),
             mock.call(['docker', 'push', 'repo1:8080/unittesting:latest']),
             mock.call(['docker', 'push', 'repo2:8080/unittesting:1.2.3']),
             mock.call(['docker', 'push', 'repo2:8080/unittesting:latest'])
         ]
     )