-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest_constants.py
More file actions
33 lines (24 loc) · 1.14 KB
/
test_constants.py
File metadata and controls
33 lines (24 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"""Tests for constants.py"""
import unittest
from constants import DEFAULT_CHUNK_SIZE, GITHUB_ISSUE_BODY_MAX_CHARS, MIN_CHUNK_SIZE
class TestConstants(unittest.TestCase):
"""Test cases for constants"""
def test_github_issue_body_max_chars(self):
"""Test that the GitHub issue body limit constant is correct"""
assert GITHUB_ISSUE_BODY_MAX_CHARS == 65535
def test_default_chunk_size(self):
"""Test that the default chunk size constant is correct"""
assert DEFAULT_CHUNK_SIZE == 100
def test_min_chunk_size(self):
"""Test that the minimum chunk size constant is correct"""
assert MIN_CHUNK_SIZE == 10
def test_constants_are_integers(self):
"""Test that all constants are integers"""
assert isinstance(GITHUB_ISSUE_BODY_MAX_CHARS, int)
assert isinstance(DEFAULT_CHUNK_SIZE, int)
assert isinstance(MIN_CHUNK_SIZE, int)
def test_chunk_size_relationships(self):
"""Test that chunk size constants have correct relationships"""
assert MIN_CHUNK_SIZE <= DEFAULT_CHUNK_SIZE
assert MIN_CHUNK_SIZE > 0
assert DEFAULT_CHUNK_SIZE > 0