Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] Testing Framework #5

Open
san-ghun opened this issue Nov 20, 2024 · 0 comments
Open

[feat] Testing Framework #5

san-ghun opened this issue Nov 20, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@san-ghun
Copy link
Owner

The codebase lacks tests. Consider adding:

  • Unit tests for core functionality
  • Integration tests for Docker operations
  • Mock objects for Docker commands
  • Test fixtures for common scenarios

Example test structure:

import pytest
from unittest.mock import patch
from pathlib import Path

def test_check_environment():
    with patch('subprocess.check_output') as mock_check:
        mock_check.return_value = "tiny42\n"
        assert _check_environment() == True

def test_invalid_workspace():
    with patch('os.getcwd') as mock_getcwd:
        mock_getcwd.return_value = "/invalid/path"
        assert _check_environment() == False
@san-ghun san-ghun added the enhancement New feature or request label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant