• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

CBIIT / crdc-datahub-cli-uploader / 21529173350

30 Jan 2026 08:10PM UTC coverage: 33.134%. First build
21529173350

push

github

AustinSMueller
Coveralls Integration

7 of 12 new or added lines in 1 file covered. (58.33%)

720 of 2173 relevant lines covered (33.13%)

0.66 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

75.86
/src/unit_test/test_config.py
1
import os
2✔
2
import sys
2✔
3
import yaml
2✔
4
import pytest
2✔
5
from unittest.mock import patch
2✔
6
from bento.common.utils import get_logger
2✔
7
from upload_config import Config
2✔
8

9

10
@pytest.fixture
2✔
11
def config_data():
2✔
12
    """Fixture to load test config data"""
13
    config_file = "../../config/test-file-config.yml"
2✔
14
    if config_file and os.path.isfile(config_file):
2✔
15
        with open(config_file) as c_file:
×
16
            return yaml.safe_load(c_file)['Config']
×
17
    return None
2✔
18

19

20
class TestConfig:
2✔
21
    """Test suite for Config class"""
22

23
    def test_validate_configs_empty(self):
2✔
24
        """Test that empty config validation fails"""
25
        with patch.object(sys, 'argv', ['uploader']):
2✔
26
            config = Config()
2✔
27
            config.data = {}
2✔
28
            result = config.validate()
2✔
29
            assert not result, "Empty config should return False"
2✔
30

31
    def test_validate_configs_valid(self, config_data):
2✔
32
        """Test that valid config passes validation"""
33
        if config_data is None:
2✔
34
            pytest.skip("Test config file not found")
2✔
NEW
35
        with patch.object(sys, 'argv', ['uploader']):
×
NEW
36
            config = Config()
×
NEW
37
            config.data = config_data
×
NEW
38
            result = config.validate()
×
NEW
39
            assert result, "Config with all valid values should return True"
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc