Skip to content

Commit

Permalink
unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lcouzens committed Nov 14, 2023
1 parent 68dae9a commit 8d72f68
Showing 1 changed file with 36 additions and 36 deletions.
72 changes: 36 additions & 36 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,19 +587,19 @@ class MainDateTest(TestCase):
def test_aws_dates(self, mock_load):
"""Test that select static-data-file dates return correct dates."""
aws_gens = [
{"aws_gen_first": {"start_date": datetime(2020, 6, 1).date(), "end_date": datetime(2020, 6, 1).date()}},
{"aws_gen_first": {"start_date": datetime(2020, 6, 1), "end_date": datetime(2020, 6, 1)}},
{
"aws_gen_first_second": {
"start_date": datetime(2020, 6, 1).date(),
"end_date": datetime(2020, 6, 2).date(),
"start_date": datetime(2020, 6, 1),
"end_date": datetime(2020, 6, 2),
}
},
{"aws_gen_first_start": {"start_date": datetime(2020, 6, 1).date()}},
{"aws_gen_last": {"start_date": datetime(2020, 5, 31).date(), "end_date": datetime(2020, 5, 31).date()}},
{"aws_gen_first_start": {"start_date": datetime(2020, 6, 1)}},
{"aws_gen_last": {"start_date": datetime(2020, 5, 31), "end_date": datetime(2020, 5, 31)}},
{
"aws_gen_last_first": {
"start_date": datetime(2020, 5, 31).date(),
"end_date": datetime(2020, 6, 1).date(),
"start_date": datetime(2020, 5, 31),
"end_date": datetime(2020, 6, 1),
}
},
]
Expand Down Expand Up @@ -639,24 +639,24 @@ def test_aws_dates(self, mock_load):
def test_aws_market_dates(self, mock_load):
"""Test that select static-data-file dates return correct dates."""
aws_mp_gens = [
{"aws_mp_gen_first": {"start_date": datetime(2020, 6, 1).date(), "end_date": datetime(2020, 6, 1).date()}},
{"aws_mp_gen_first": {"start_date": datetime(2020, 6, 1), "end_date": datetime(2020, 6, 1)}},
{
"aws_mp_gen_first_second": {
"start_date": datetime(2020, 6, 1).date(),
"end_date": datetime(2020, 6, 2).date(),
"start_date": datetime(2020, 6, 1),
"end_date": datetime(2020, 6, 2),
}
},
{"aws_mp_gen_first_start": {"start_date": datetime(2020, 6, 1).date()}},
{"aws_mp_gen_first_start": {"start_date": datetime(2020, 6, 1)}},
{
"aws_mp_gen_last": {
"start_date": datetime(2020, 5, 31).date(),
"end_date": datetime(2020, 5, 31).date(),
"start_date": datetime(2020, 5, 31),
"end_date": datetime(2020, 5, 31),
}
},
{
"aws_mp_gen_last_first": {
"start_date": datetime(2020, 5, 31).date(),
"end_date": datetime(2020, 6, 1).date(),
"start_date": datetime(2020, 5, 31),
"end_date": datetime(2020, 6, 1),
}
},
]
Expand Down Expand Up @@ -696,19 +696,19 @@ def test_aws_market_dates(self, mock_load):
def test_ocp_dates(self, mock_load):
"""Test that select static-data-file dates return correct dates."""
ocp_gens = [
{"ocp_gen_first": {"start_date": "2020-06-01", "end_date": datetime(2020, 6, 1).date()}},
{"ocp_gen_first": {"start_date": "2020-06-01", "end_date": datetime(2020, 6, 1)}},
{
"ocp_gen_first_second": {
"start_date": datetime(2020, 6, 1).date(),
"end_date": datetime(2020, 6, 2).date(),
"start_date": datetime(2020, 6, 1),
"end_date": datetime(2020, 6, 2),
}
},
{"ocp_gen_first_start": {"start_date": datetime(2020, 6, 1).date()}},
{"ocp_gen_last": {"start_date": datetime(2020, 5, 31).date(), "end_date": datetime(2020, 5, 31).date()}},
{"ocp_gen_first_start": {"start_date": datetime(2020, 6, 1)}},
{"ocp_gen_last": {"start_date": datetime(2020, 5, 31), "end_date": datetime(2020, 5, 31)}},
{
"ocp_gen_last_first": {
"start_date": datetime(2020, 5, 31).date(),
"end_date": datetime(2020, 6, 1).date(),
"start_date": datetime(2020, 5, 31),
"end_date": datetime(2020, 6, 1),
}
},
{"ocp_gen_times": {"start_date": "2023-08-01T05", "end_date": "2023-08-02T23:45"}},
Expand Down Expand Up @@ -753,19 +753,19 @@ def test_ocp_dates(self, mock_load):
def test_azure_dates(self, mock_load):
"""Test that select static-data-file dates return correct dates."""
azure_gens = [
{"azure_gen_first": {"start_date": datetime(2020, 6, 1).date(), "end_date": datetime(2020, 6, 1).date()}},
{"azure_gen_first": {"start_date": datetime(2020, 6, 1), "end_date": datetime(2020, 6, 1)}},
{
"azure_gen_first_second": {
"start_date": datetime(2020, 6, 1).date(),
"end_date": datetime(2020, 6, 2).date(),
"start_date": datetime(2020, 6, 1),
"end_date": datetime(2020, 6, 2),
}
},
{"azure_gen_first_start": {"start_date": datetime(2020, 6, 1).date()}},
{"azure_gen_last": {"start_date": datetime(2020, 5, 31).date(), "end_date": datetime(2020, 5, 31).date()}},
{"azure_gen_first_start": {"start_date": datetime(2020, 6, 1)}},
{"azure_gen_last": {"start_date": datetime(2020, 5, 31), "end_date": datetime(2020, 5, 31)}},
{
"azure_gen_last_first": {
"start_date": datetime(2020, 5, 31).date(),
"end_date": datetime(2020, 6, 1).date(),
"start_date": datetime(2020, 5, 31),
"end_date": datetime(2020, 6, 1),
}
},
]
Expand Down Expand Up @@ -806,19 +806,19 @@ def test_azure_dates(self, mock_load):
def test_oci_dates(self, mock_load):
"""Test that select static-data-file dates return correct dates."""
oci_gens = [
{"oci_gen_first": {"start_date": datetime(2020, 6, 1).date(), "end_date": datetime(2020, 6, 1).date()}},
{"oci_gen_first": {"start_date": datetime(2020, 6, 1), "end_date": datetime(2020, 6, 1)}},
{
"oci_gen_first_second": {
"start_date": datetime(2020, 6, 1).date(),
"end_date": datetime(2020, 6, 2).date(),
"start_date": datetime(2020, 6, 1),
"end_date": datetime(2020, 6, 2),
}
},
{"oci_gen_first_start": {"start_date": datetime(2020, 6, 1).date()}},
{"oci_gen_last": {"start_date": datetime(2020, 5, 31).date(), "end_date": datetime(2020, 5, 31).date()}},
{"oci_gen_first_start": {"start_date": datetime(2020, 6, 1)}},
{"oci_gen_last": {"start_date": datetime(2020, 5, 31), "end_date": datetime(2020, 5, 31)}},
{
"oci_gen_last_first": {
"start_date": datetime(2020, 5, 31).date(),
"end_date": datetime(2020, 6, 1).date(),
"start_date": datetime(2020, 5, 31),
"end_date": datetime(2020, 6, 1),
}
},
]
Expand Down

0 comments on commit 8d72f68

Please sign in to comment.