-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
82 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,5 @@ jobs: | |
with: | ||
python-version: "3.8" | ||
- uses: pre-commit/[email protected] | ||
- run: pip install . | ||
- run: bscal | ||
- run: bscal 2079 | ||
- run: bscal 2079 3 | ||
- run: pip install -e ".[tests]" | ||
- run: pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import pytest | ||
|
||
from bscal import main | ||
|
||
results_2080_poush = """\ | ||
Poush 2080 | ||
Su Mo Tu We Th Fr Sa | ||
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 | ||
""" | ||
|
||
results_2080 = """\ | ||
2080 | ||
Baisakh Jestha Asadh | ||
Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa | ||
1 2 1 2 3 4 5 6 1 2 | ||
3 4 5 6 7 8 9 7 8 9 10 11 12 13 3 4 5 6 7 8 9 | ||
10 11 12 13 14 15 16 14 15 16 17 18 19 20 10 11 12 13 14 15 16 | ||
17 18 19 20 21 22 23 21 22 23 24 25 26 27 17 18 19 20 21 22 23 | ||
24 25 26 27 28 29 30 28 29 30 31 32 24 25 26 27 28 29 30 | ||
31 31 | ||
Shrawan Bhadra Asoj | ||
Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa | ||
1 2 3 4 5 6 1 2 1 2 3 4 5 6 | ||
7 8 9 10 11 12 13 3 4 5 6 7 8 9 7 8 9 10 11 12 13 | ||
14 15 16 17 18 19 20 10 11 12 13 14 15 16 14 15 16 17 18 19 20 | ||
21 22 23 24 25 26 27 17 18 19 20 21 22 23 21 22 23 24 25 26 27 | ||
28 29 30 31 32 24 25 26 27 28 29 30 28 29 30 | ||
31 | ||
Kartik Mangsir Poush | ||
Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa | ||
1 2 3 4 1 2 1 2 3 4 5 6 7 | ||
5 6 7 8 9 10 11 3 4 5 6 7 8 9 8 9 10 11 12 13 14 | ||
12 13 14 15 16 17 18 10 11 12 13 14 15 16 15 16 17 18 19 20 21 | ||
19 20 21 22 23 24 25 17 18 19 20 21 22 23 22 23 24 25 26 27 28 | ||
26 27 28 29 30 24 25 26 27 28 29 30 29 | ||
Magh Falgun Chaitra | ||
Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa | ||
1 2 3 4 5 6 1 2 3 4 5 1 2 3 | ||
7 8 9 10 11 12 13 6 7 8 9 10 11 12 4 5 6 7 8 9 10 | ||
14 15 16 17 18 19 20 13 14 15 16 17 18 19 11 12 13 14 15 16 17 | ||
21 22 23 24 25 26 27 20 21 22 23 24 25 26 18 19 20 21 22 23 24 | ||
28 29 27 28 29 30 25 26 27 28 29 30 | ||
""" | ||
|
||
|
||
@pytest.mark.parametrize( | ||
("args", "expected"), | ||
[ | ||
(("2080", "9"), results_2080_poush), | ||
(("2080",), results_2080), | ||
], | ||
) | ||
def test_cli(capsys, args, expected): | ||
main(args) | ||
out, err = capsys.readouterr() | ||
assert out == expected | ||
assert not err |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from hypothesis import given | ||
from hypothesis.strategies import dates | ||
|
||
from bscal import ad_to_bs, bs_to_ad, new_years | ||
|
||
|
||
@given(dates(min(new_years.values()), max(new_years.values()))) | ||
def test(date): | ||
assert bs_to_ad(*ad_to_bs(date)) == date |