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

blue-marble / gridpath / 24749687065

21 Apr 2026 10:27PM UTC coverage: 89.044% (+0.04%) from 89.008%
24749687065

Pull #1351

github

web-flow
Merge 4fa569459 into 7563781e9
Pull Request #1351: RA Toolkit updates

500 of 565 new or added lines in 29 files covered. (88.5%)

1 existing line in 1 file now uncovered.

28063 of 31516 relevant lines covered (89.04%)

0.89 hits per line

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

88.46
/tests/test_data_toolkit/system/test_create_sync_load_input_csvs.py
1
# Copyright 2016-2024 Blue Marble Analytics LLC.
2
#
3
# Licensed under the Apache License, Version 2.0 (the "License");
4
# you may not use this file except in compliance with the License.
5
# You may obtain a copy of the License at
6
#
7
#     http://www.apache.org/licenses/LICENSE-2.0
8
#
9
# Unless required by applicable law or agreed to in writing, software
10
# distributed under the License is distributed on an "AS IS" BASIS,
11
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
# See the License for the specific language governing permissions and
13
# limitations under the License.
14

15
import os
1✔
16
import unittest
1✔
17

18
from db.create_database import main as create_database_main
1✔
19
from data_toolkit.system.create_sync_load_input_csvs import (
1✔
20
    main as create_sync_load_input_csvs_main,
21
)
22

23

24
class TestCreateSyncLoadInputCsvs(unittest.TestCase):
1✔
25
    """
26
    Test create_sync_load_input_csvs script
27
    """
28

29
    @classmethod
1✔
30
    def setUpClass(cls):
1✔
31
        """Set up test environment"""
32
        os.chdir(os.path.join(os.path.dirname(__file__), "..", "..", "..", "db"))
1✔
33
        cls.db_path = "ra_toolkit_test_steps_temp.db"
1✔
34

35
        # Clean up temp database if it exists
36
        if os.path.exists(cls.db_path):
1✔
NEW
37
            os.remove(cls.db_path)
×
38

39
        # Create database first
40
        create_db_args = [
1✔
41
            "--database",
42
            cls.db_path,
43
            "--db_schema",
44
            "../data_toolkit/raw_data_db_schema.sql",
45
            "--quiet",
46
        ]
47
        create_database_main(create_db_args)
1✔
48

49
    def test_create_sync_load_input_csvs(self):
1✔
50
        """Test create_sync_load_input_csvs with hardcoded arguments"""
51
        args = [
1✔
52
            "--database",
53
            self.db_path,
54
            "--load_profile_input_csv",
55
            "./csvs_test_examples/raw_data_ra_toolkit/system_load"
56
            "/ra_toolkit_load.csv",
57
            "--units_input_csv",
58
            "./csvs_test_examples/raw_data_ra_toolkit/system_load"
59
            "/user_defined_load_zone_units.csv",
60
            "--output_directory",
61
            "./csvs_test_examples/system_load/system_load",
62
            "--load_scenario_id",
63
            "13",
64
            "--load_scenario_name",
65
            "ra_toolkit_module_tests_sync",
66
            "--load_components_scenario_id",
67
            "7",
68
            "--load_components_scenario_name",
69
            "ra_toolkit_module_tests_sync",
70
            "--load_levels_scenario_id",
71
            "14",
72
            "--load_levels_scenario_name",
73
            "ra_toolkit_module_tests_sync",
74
            "--load_levels_overwrite",
75
            "--load_components_overwrite",
76
            "--load_scenario_overwrite",
77
            "--quiet",
78
        ]
79
        create_sync_load_input_csvs_main(args)
1✔
80

81
    @classmethod
1✔
82
    def tearDownClass(cls):
1✔
83
        """Clean up test database"""
84
        if os.path.exists(cls.db_path):
1✔
85
            os.remove(cls.db_path)
1✔
86
        for temp_file_ext in ["-shm", "-wal"]:
1✔
87
            temp_file = f"{cls.db_path}{temp_file_ext}"
1✔
88
            if os.path.exists(temp_file):
1✔
NEW
89
                os.remove(temp_file)
×
90

91

92
if __name__ == "__main__":
1✔
NEW
93
    unittest.main()
×
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