def test_no_service(self): bash(self.project, {'SERVICE': 'foo'})
def test_no_container(self): mock_client = mock.create_autospec(docker.Client) mock_client.containers.return_value = self.mock_container('nope_1') self.project = Project.from_dicts('test', project, mock_client) bash(self.project, {'SERVICE': 'web'})
def test_bash(self): with mock.patch('os.system') as call: bash(self.project, {'SERVICE': 'web'}) call.assert_called_with('docker exec -t -i test_web_1 /bin/bash')