Skip to content

Commit

Permalink
add major Taiwan and China cities in Chinese
Browse files Browse the repository at this point in the history
  • Loading branch information
hoishing committed Nov 26, 2024
1 parent c3c0a99 commit 10f7af3
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 8 deletions.
Binary file modified demo_report_light.pdf
Binary file not shown.
Binary file modified demo_report_mono.pdf
Binary file not shown.
1 change: 0 additions & 1 deletion natal/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ class Chart(ModelDict):
pos_adj_factor: float = 2.2



class Config(ModelDict):
"""
Package configuration model.
Expand Down
Binary file modified natal/data/cities.csv.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "natal"
version = "0.8.4"
version = "0.8.5"
description = "create Natal Chart with ease"
license = "MIT"
repository = "https://github.com/hoishing/natal"
Expand Down
20 changes: 14 additions & 6 deletions tests/test_report.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import pytest
from io import BytesIO
from pathlib import Path
from natal import Chart, Config, Data, Stats
from natal import Config, Data
from natal.config import Orb
from natal.report import Report

Expand Down Expand Up @@ -93,6 +92,15 @@ def test_cross_ref(report):
assert grid[1][1] == ""
assert grid[4][4].startswith("<svg")


def test_orb(report):
grid = report.orbs
assert len(grid) == 7
assert grid[1][1] == 2
assert grid[4][0].startswith("<svg")
assert grid[6][1] == 0


def test_full_report(report):
full_report = report.full_report
assert isinstance(full_report, str)
Expand All @@ -102,12 +110,12 @@ def test_full_report(report):
def test_create_pdf(report):
html = report.full_report
pdf = report.create_pdf(html)

# Check it's a BytesIO object
assert isinstance(pdf, BytesIO)
assert pdf.getbuffer().nbytes > 0

# Check PDF magic numbers
pdf.seek(0)
header = pdf.read(4).decode('utf-8')
assert header == '%PDF', "File doesn't start with PDF header"
header = pdf.read(4).decode("utf-8")
assert header == "%PDF", "File doesn't start with PDF header"

0 comments on commit 10f7af3

Please sign in to comment.