• 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/test_load_raw_data.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.load_raw_data import main as load_raw_data_main
1✔
20

21

22
class TestLoadRawData(unittest.TestCase):
1✔
23
    """
24
    Test load_raw_data script
25
    """
26

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

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

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

47
    def test_load_raw_data(self):
1✔
48
        """Test load_raw_data with hardcoded arguments"""
49
        args = [
1✔
50
            "--database",
51
            self.db_path,
52
            "--csv_location",
53
            "./csvs_test_examples/raw_data_ra_toolkit/",
54
            "--quiet",
55
        ]
56
        load_raw_data_main(args)
1✔
57

58
    @classmethod
1✔
59
    def tearDownClass(cls):
1✔
60
        """Clean up test database"""
61
        if os.path.exists(cls.db_path):
1✔
62
            os.remove(cls.db_path)
1✔
63
        for temp_file_ext in ["-shm", "-wal"]:
1✔
64
            temp_file = f"{cls.db_path}{temp_file_ext}"
1✔
65
            if os.path.exists(temp_file):
1✔
NEW
66
                os.remove(temp_file)
×
67

68

69
if __name__ == "__main__":
1✔
NEW
70
    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