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

blue-marble / gridpath / 24222694482

10 Apr 2026 02:03AM UTC coverage: 88.95% (-0.006%) from 88.956%
24222694482

Pull #1351

github

web-flow
Merge f4be4f05e into ad380fcdb
Pull Request #1351: RA Toolkit updates

496 of 574 new or added lines in 27 files covered. (86.41%)

1 existing line in 1 file now uncovered.

27869 of 31331 relevant lines covered (88.95%)

0.89 hits per line

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

86.96
/tests/test_data_toolkit/test_create_database.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

20

21
class TestCreateDatabase(unittest.TestCase):
1✔
22
    """
23
    Test create_database script
24
    """
25

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

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

36
    def test_create_database(self):
1✔
37
        """Test create_database with hardcoded arguments"""
38
        args = [
1✔
39
            "--database",
40
            self.db_path,
41
            "--db_schema",
42
            "../data_toolkit/raw_data_db_schema.sql",
43
            "--quiet",
44
        ]
45
        create_database_main(args)
1✔
46

47
    @classmethod
1✔
48
    def tearDownClass(cls):
1✔
49
        """Clean up test database"""
50
        if os.path.exists(cls.db_path):
1✔
51
            os.remove(cls.db_path)
1✔
52
        for temp_file_ext in ["-shm", "-wal"]:
1✔
53
            temp_file = f"{cls.db_path}{temp_file_ext}"
1✔
54
            if os.path.exists(temp_file):
1✔
NEW
55
                os.remove(temp_file)
×
56

57

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