Skip to content

Commit ff4588c

Browse files
committed
Ran black on tests.
1 parent 4228d21 commit ff4588c

3 files changed

Lines changed: 35 additions & 13 deletions

File tree

tests/test_date.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def test_localize_offset(jd):
7878

7979
def test_localize_timezone(jd):
8080
dt = datetime(2000, 1, 1, 10)
81-
aware = date.localize(dt, time_zone='America/Los_Angeles')
81+
aware = date.localize(dt, time_zone="America/Los_Angeles")
8282
assert date.to_jd(aware) == jd
8383

8484

@@ -100,7 +100,7 @@ def test_to_jd(str_pst_date, gmt_date, pst_date, pst_coords, gmt_coords, jd):
100100
assert date.to_jd(jd) == jd
101101
assert date.to_jd(str_pst_date, *pst_coords) == jd
102102
assert date.to_jd(str_pst_date, *gmt_coords, offset=-8.0) == jd
103-
assert date.to_jd(str_pst_date, time_zone='America/Los_Angeles') == jd
103+
assert date.to_jd(str_pst_date, time_zone="America/Los_Angeles") == jd
104104
assert date.to_jd(gmt_date) == jd
105105
assert date.to_jd(pst_date) == jd
106106

@@ -179,7 +179,7 @@ def test_to_datetime_pst(pst_date, str_pst_date, pst_coords, gmt_coords, jd):
179179
assert dt_from_offset.minute == 0
180180
assert dt_from_offset.second == 0
181181

182-
dt_from_time_zone = date.to_datetime(jd, time_zone='America/Los_Angeles')
182+
dt_from_time_zone = date.to_datetime(jd, time_zone="America/Los_Angeles")
183183
assert dt_from_time_zone.year == 2000
184184
assert dt_from_time_zone.month == 1
185185
assert dt_from_time_zone.day == 1

tests/test_ephemeris.py

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,9 @@ def test_get_armc_angle(jd, coords, armc, all_angles):
343343
obliquity = ephemeris.earth_obliquity(jd)
344344

345345
for index in all_angles:
346-
angle = ephemeris.get_armc_angle(index, armc, coords[0], obliquity, chart.PLACIDUS)
346+
angle = ephemeris.get_armc_angle(
347+
index, armc, coords[0], obliquity, chart.PLACIDUS
348+
)
347349
assert angle["index"] == index and angle["type"] == chart.ANGLE
348350

349351
assert ephemeris.get_armc_angle(
@@ -377,7 +379,9 @@ def test_get_armc_house(jd, coords, armc, all_houses):
377379
obliquity = ephemeris.earth_obliquity(jd)
378380

379381
for index in all_houses:
380-
house = ephemeris.get_armc_house(index, armc, coords[0], obliquity, chart.PLACIDUS)
382+
house = ephemeris.get_armc_house(
383+
index, armc, coords[0], obliquity, chart.PLACIDUS
384+
)
381385
assert house["index"] == index and house["type"] == chart.HOUSE
382386

383387
assert ephemeris.get_armc_house(
@@ -471,8 +475,12 @@ def test_get_data(coords, jd, astro):
471475
"juno": ephemeris.get_asteroid(chart.JUNO, jd), # Included with planets
472476
"lilith": ephemeris.get_asteroid(1181, jd), # From external file
473477
"antares": ephemeris.get_fixed_star("Antares", jd),
474-
"pre_natal_solar_eclipse": ephemeris.get_eclipse(chart.PRE_NATAL_SOLAR_ECLIPSE, jd),
475-
"pre_natal_lunar_eclipse": ephemeris.get_eclipse(chart.PRE_NATAL_LUNAR_ECLIPSE, jd),
478+
"pre_natal_solar_eclipse": ephemeris.get_eclipse(
479+
chart.PRE_NATAL_SOLAR_ECLIPSE, jd
480+
),
481+
"pre_natal_lunar_eclipse": ephemeris.get_eclipse(
482+
chart.PRE_NATAL_LUNAR_ECLIPSE, jd
483+
),
476484
"post_natal_solar_eclipse": ephemeris.get_eclipse(
477485
chart.POST_NATAL_SOLAR_ECLIPSE, jd
478486
),
@@ -540,6 +548,7 @@ def test_armc_get_data(coords, jd, astro, armc):
540548
--------------------------------------------------------------------------------
541549
"""
542550

551+
543552
def test_part_of_fortune_day_formula(day_jd, coords):
544553
sun, moon, asc = ephemeris.get_objects(
545554
(chart.SUN, chart.MOON, chart.ASC), day_jd, *coords, chart.PLACIDUS
@@ -638,7 +647,12 @@ def test_is_daytime(day_jd, night_jd, coords):
638647

639648
def test_armc_is_daytime(day_jd, coords, armc):
640649
# Sun above ascendant in astro.com chart visual
641-
assert ephemeris.armc_is_daytime(day_jd, armc, coords[0], ephemeris.earth_obliquity(day_jd)) is True
650+
assert (
651+
ephemeris.armc_is_daytime(
652+
day_jd, armc, coords[0], ephemeris.earth_obliquity(day_jd)
653+
)
654+
is True
655+
)
642656

643657

644658
def test_is_daytime_from(day_jd, night_jd, coords):
@@ -657,7 +671,7 @@ def test_moon_phase(jd):
657671
# Courtesy of https://stardate.org/nightsky/moon
658672
assert (
659673
ephemeris.moon_phase(jd) == calc.THIRD_QUARTER
660-
) is True # third quarter = waning crescent
674+
) is True # third quarter = waning crescent
661675

662676

663677
def test_moon_phase_from(jd):
@@ -666,7 +680,7 @@ def test_moon_phase_from(jd):
666680
moon = ephemeris.get_planet(chart.MOON, jd)
667681
assert (
668682
ephemeris.moon_phase_from(sun, moon) == calc.THIRD_QUARTER
669-
) is True # third quarter = waning crescent
683+
) is True # third quarter = waning crescent
670684

671685

672686
def test_earth_obliquity(jd):
@@ -840,6 +854,7 @@ def test_solar_year_length():
840854
--------------------------------------------------------------------------------
841855
"""
842856

857+
843858
def test_previous_aspect(jd, coords):
844859
# Check for previous Sun / Moon conjunction so we can use the same
845860
# test date/time as test_previous_new_moon()

tests/test_localization.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ def teardown_function():
180180
def test_date_locale(native):
181181
settings.locale = "pt_BR"
182182
assert (
183-
str(wrap.Subject(native)) == "Sáb Jan 01 2000 10:00:00 America/Los_Angeles em 32N43.0, 117W9.0"
183+
str(wrap.Subject(native))
184+
== "Sáb Jan 01 2000 10:00:00 America/Los_Angeles em 32N43.0, 117W9.0"
184185
)
185186

186187

@@ -531,7 +532,10 @@ def test_formatted_ambiguous_datetime(lat, lon):
531532
settings.locale = "pt_BR"
532533
ambiguous_native = charts.Subject("2022-11-06 01:30", lat, lon)
533534
natal = charts.Natal(ambiguous_native)
534-
assert str(natal.native.date_time) == "Dom Nov 06 2022 01:30:00 America/Los_Angeles (ambíguo)"
535+
assert (
536+
str(natal.native.date_time)
537+
== "Dom Nov 06 2022 01:30:00 America/Los_Angeles (ambíguo)"
538+
)
535539

536540

537541
def test_formatted_aspect(native):
@@ -554,7 +558,10 @@ def test_formatted_object(native):
554558
def test_formatted_subject(native):
555559
settings.locale = "pt_BR"
556560
natal = charts.Natal(native)
557-
assert str(natal.native) == "Sáb Jan 01 2000 10:00:00 America/Los_Angeles em 32N43.0, 117W9.0"
561+
assert (
562+
str(natal.native)
563+
== "Sáb Jan 01 2000 10:00:00 America/Los_Angeles em 32N43.0, 117W9.0"
564+
)
558565

559566

560567
def test_formatted_weightings_elements(native):

0 commit comments

Comments
 (0)