Skip to content

Commit

Permalink
test: test for deepcopy bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dmuldrew committed Apr 6, 2020
1 parent 4761cea commit 1920302
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion powersimdata/input/tests/test_grid.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import numpy as np
import pandas as pd
import pytest
import copy

from powersimdata.input.usa_tamu_model import check_interconnect
from powersimdata.input.helpers import add_column_to_data_frame
Expand Down Expand Up @@ -209,4 +210,10 @@ def test_link():
assert np.array_equal(list(output.keys()), keys)
assert np.array_equal(list(output.values()), values)
assert np.array_equal(output['a'], values[0])
assert np.array_equal(output['c'], values[2])
assert np.array_equal(output['c'], values[2])


def test_deepcopy_works():
g = Grid(['Texas'])
copied_grid = copy.deepcopy(g)
assert isinstance(copied_grid, Grid)

0 comments on commit 1920302

Please sign in to comment.