Skip to content

Commit

Permalink
fix: core test
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgiga1993 committed Nov 19, 2024
1 parent fdcd5c6 commit 3f80204
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions tests/test_Core.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ def test_resolve(self):
scheduler = ExecutionScheduler(config, executors)

def run():
self.assertIsInstance(config.writer, InMemoryWriter)
data = config.writer.data
self.assertEqual(config.writer.write_calls, 1)
self.assertIsInstance(config.writers[0], InMemoryWriter)
data = config.writers[0].data
self.assertEqual(config.writers[0].write_calls, 1)
self.assertGreater(len(data), 0)
self.assertEqual('10', data[0][0].values[0].value)
self.assertEqual('1', data[0][1].values[0].value)
Expand Down Expand Up @@ -87,8 +87,8 @@ def test_exec(self):
scheduler = ExecutionScheduler(config, executors)

def run():
self.assertIsInstance(config.writer, InMemoryWriter)
data = config.writer.data
self.assertIsInstance(config.writers[0], InMemoryWriter)
data = config.writers[0].data
self.assertGreater(len(data), 0)

self._run_and_stop(scheduler, 1, run)
Expand Down Expand Up @@ -157,11 +157,11 @@ def test_exec_parallel(self):
scheduler = ExecutionScheduler(config, executors)

def run():
self.assertIsInstance(config.writer, ParallelInMemoryWriter)
self.assertIsInstance(config.writers[0], ParallelInMemoryWriter)
# Wait for the jobs to complete
sleep(2.5)
data = config.writer.data
self.assertEqual(config.writer.write_calls, 2)
data = config.writers[0].data
self.assertEqual(config.writers[0].write_calls, 2)
self.assertEqual(len(data), 2)

self._run_and_stop(scheduler, 1, run)
Expand Down Expand Up @@ -205,12 +205,12 @@ def test_parallel_executor(self):
scheduler = ExecutionScheduler(config, executors)

def run():
self.assertIsInstance(config.writer, ParallelInMemoryWriter)
self.assertIsInstance(config.writers[0], ParallelInMemoryWriter)
# Wait for the collection b to complete a couple of times
sleep(2)
data = config.writer.data
print(f'Write calls: {config.writer.write_calls}')
self.assertTrue(config.writer.write_calls >= 2)
data = config.writers[0].data
print(f'Write calls: {config.writers[0].write_calls}')
self.assertTrue(config.writers[0].write_calls >= 2)
for entry in data:
for value in entry:
self.assertEqual(4, value.values[0].value)
Expand Down

0 comments on commit 3f80204

Please sign in to comment.