Skip to content

Commit

Permalink
Update test_data_read
Browse files Browse the repository at this point in the history
  • Loading branch information
liuly12 committed Oct 2, 2024
1 parent dd715b0 commit 4a1c9ca
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/test_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from wsimod.nodes.storage import Storage
from wsimod.nodes.waste import Waste
from pathlib import Path

import pandas as pd

class MyTestClass(TestCase):
def setUp(self):
Expand Down Expand Up @@ -413,10 +413,12 @@ def test_deny(self):
self.assertDictEqual(d2, reply)

def test_data_read(self):
node = Node(name="", data_input_dict={("temperature", 1): 15})
node.t = 1
data_path = '../docs/demo/data/processed/timeries_data.csv'
input_data = pd.read_csv(data_path)
node = Node(name="", data_input_dict=data_path)
node.t = Node.data_input_dict.keys()[0][1]

self.assertEqual(15, node.get_data_input("temperature"))
self.assertEqual(input_data['temperature'].iloc[0], node.get_data_input("temperature"))


if __name__ == "__main__":
Expand Down

0 comments on commit 4a1c9ca

Please sign in to comment.